home *** CD-ROM | disk | FTP | other *** search
/ Executor 2.0 / executorv2.0.iso / pc / dos / extra / library / demoware / asymptot.hqx / Asymptote 1.1 Demo / Asymptote Help Text < prev    next >
Encoding:
Text File  |  1994-10-27  |  193.7 KB  |  4,851 lines

  1. Copyright ’ 1988-1994, Brains software, All Rights Reserved.
  2. $$Apple Menu
  3. Using Menu Commands
  4. Menu Command                            Asymptote command
  5. $i$About Asymptote$i$
  6.     ± Display version, registration and copyright information
  7. $i$Help...$i$
  8.     ± Access this on-line help system                $b$help$b$
  9.     
  10.     ¥¥ For more information on the on-line help system, type
  11.         help help
  12.          in the $i$Command Window$i$
  13. $$File Menu
  14. Using Menu Commands
  15. Menu Command                            Asymptote command
  16. $i$New$i$
  17.     ± Open a new Text Editor Window                $b$newwindow$b$
  18. $i$Open...$i$
  19.     ± Open an existing text file
  20. $i$Recorder$i$
  21.     ± Specify which window is the recorder
  22.     ¥ See also the topic: $i$Recorder menu$i$
  23. $i$Data$i$
  24.     ± Specify which window is the data file            $b$datafile$b$
  25.     ¥ See also the topic: $i$Data menu$i$
  26. $i$Close$i$
  27.     ± Close a window                        $b$closewindow$b$
  28. $i$Save$i$
  29.     ± Save the contents of the active window to a disk file
  30. $i$Save As...$i$
  31.     ± Save the contents of the active window under a 
  32.         different filename
  33. $i$Graph Page Setup...$i$
  34.     ± Choose a new graph page setup                 $b$pagesetup$b$
  35.     ¥ See also the topic: $i$Graph Page Setup menu$i$
  36. $i$Print Graph$i$
  37.     ± Print the contents of the $i$Graph Window$i$            $b$print$b$
  38. $i$File Page Setup...$i$
  39.     ± Change the page setup for a Text Editor Window
  40. $i$Print File$i$
  41.     ± Print a Text Editor Window
  42. $i$Options$i$
  43.     ± Change options for Asymptote
  44.         ¥ See also the help topics:     $i$Options menu$i$
  45.                     $i$Memory Use$i$
  46.                     $i$Preferences$i$
  47.                     $i$Search Paths$i$
  48.                     $i$Command Macros$i$            
  49. $i$Quit$i$                                    $b$quit$b$
  50.     ± Quit Asymptote
  51. $$Graph Page Setup
  52. sub-menu under the File Menu
  53. Menu Command                            Asymptote command
  54. $i$New Page Setup...$i$                                   $b$pagesetup ?$b$
  55.     ± Choose a new graph page setup
  56. $i$Save to recorder$i$
  57.     ± Save the current graph page setup to the Recorder
  58. $i$Read from recorder$i$
  59.     ± Read the graph page setup from the Recorder        $b$pagesetup$b$
  60. $$Options
  61. sub-menu under the File Menu
  62. Menu Command                            Asymptote command
  63. $i$Preferences...$i$
  64.     ± Select your personal preferences                see:$i$Preferences$i$ 
  65. $i$Memory Use$i$
  66.     ± Configure how Asymptote uses memory            see:$i$Memory Use$i$ 
  67. $i$Search Paths File...$i$
  68.     ± Select a Search Paths File                    see:$i$Search Paths$i$ 
  69. $i$Command Macros$i$
  70.     ± Select a command macros file                see:$i$Command˚Macros$i$ 
  71. $$Preferences
  72. Menu Command on the Options sub-menu
  73. To make changes to your preferences simply check or uncheck the various items and 
  74. click on the OK button.  Asymptote remembers your preferences until you change 
  75. them again.
  76.  
  77. $b$Dialog and Alert Preferences$b$ 
  78. $i$Center dialog and alert boxes on screen$i$
  79. When you select this preference, Asymptote centers dialogs and alert boxes on your 
  80. screen.  If you have a large screen, you may find this preference particularly helpful.  
  81. Deselect this preference if you want dialog and alert boxes to appear below the menu 
  82. bar instead.
  83.  
  84. $i$Show note alerts$i$
  85. From time to time Asymptote displays a note alert with non-essential information. 
  86. If you donàt want to be bothered by these notes, deselect this preference.  Turning 
  87. off note alerts is particularly useful when running a script in the background because
  88. note alerts interrupt the execution of scripts.
  89.  
  90. $i$Notify me when the Recorder stops playing in the background$i$
  91. Select this preference if you want Asymptote to tell you when it has finished running 
  92. a script in the background.  The notification message looks like this:
  93.  
  94. Selecting this preference is a convenient way to have Asymptote notify you when it has 
  95. finished drawing your graph while running in the background.
  96.  
  97. $b$Script Preferences$b$ 
  98. $i$Execute the script Asymptote Startup when Asymptote starts$i$
  99. When you select this preference, Asymptote runs the script named Asymptote Startup 
  100. every time it starts up.  The Asymptote Startup script is a convenient way to configure 
  101. Asymptote with your personal preferences for the variables of the 
  102. $i$graphics environment$i$ such as pen size, font, and fill pattern every time Asymptote 
  103. starts up.  For more information on the $i$Startup script$i$ see Appendix A of
  104. the Asymptote $i$User's Guide$i$. 
  105.  
  106. $i$Clear the Graph Window before running the Recorder script$i$
  107. When you select this preference, Asymptote clears the $i$Graph Window$i$ every time you 
  108. run the Recorder.  If you deselect this preference, the new graph is drawn on top of the 
  109. old graph every time you run the Recorder.  If you are running the same script over and 
  110. over again in order to make changes to your graph, you probably want to select this 
  111. preference.  If you are running several different scripts to draw multiple graphs on the 
  112. same page, you probably want to deselect this preference.  Remember, you can always 
  113. use the clear command to clear the $i$Graph Window$i$ whenever you need a blank page.
  114.  
  115. $i$Donàt update the Status and Vectors Windows$i$
  116. The $i$Status$i$ and $i$Vectors Windows$i$ are very useful tools for debugging your 
  117. scripts.  You can use them to monitor changes to the $i$graphics˚environment$i$ and the
  118. values in Asymptotes vectors.  But updating these windows takes time and makes your 
  119. scripts take longer to run.  Once you have debugged your scripts, you probably want to 
  120. select this preference to make your scripts run faster.  Closing the $i$Status$i$ and $i$Vectors$i$ 
  121. Windows when you arenàt using them also makes your scripts run faster.
  122.  
  123. ¥ Note:  If you have selected this preference and want to have Asymptote update the 
  124. $i$Status$i$ or $i$Vectors$i$ Windows while Asymptote is running a script, simply click 
  125. the window to have Asymptote update its contents.
  126.  
  127. $i$Trace the execution of scripts$i$
  128. This preference is useful when you are debugging your scripts because you can monitor 
  129. how your scripts are running.  When you select this preference, Asymptote scrolls 
  130. through the text in your scripts to show you which line is currently being executed.  
  131. Scrolling through the text and updating windows takes time, however, so if you want 
  132. your scripts to run faster, deselect this preference.
  133.  
  134. $i$Add new commands at the end of the Recorder$i$
  135. When you type commands in the Command Window or select commands from menus, 
  136. Asymptote saves the command in the $i$Recorder Window$i$.  When you select this preference,
  137. Asymptote saves new commands at the end of the current Recorder script.  In this way, 
  138. the $i$Recorder$i$ provides a history of all the commands you used to produce a graph.  
  139. After youàve created a graph, you may want to add commands in the middle of your 
  140. Recorder script to make changes in your graph.  In this case, you may prefer to 
  141. deselect this preference to have Asymptote insert new commands at the current position 
  142. of the insertion point in your Recorder script.  With this preference deselected, you can 
  143. type commands in the Command Window or select commands from Asymptoteàs menus to 
  144. have Asymptote insert them at the current insertion point in your Recorder script.
  145. ¥ Note:  The order in which Asymptote executes commands is important.  If you add 
  146. commands in the middle of your Recorder script, be sure to run the Recorder from 
  147. time to time to see if executing the commands in sequence produces the results you want.
  148.  
  149. $b$Other Preferences$b$ 
  150. $i$Show the graph cursor information box in the Graph Window$i$
  151. When you issue commands that activate the graph cursor (for example, $b$moveto$b$ ? or 
  152. $b$drawto$b$ ?) Asymptote activates the graph cursor.  Select this preference if you 
  153. want Asymptote to display information about the current position of the graph cursor 
  154. in the $i$Graph Window$i$. 
  155.  
  156. $i$Show the names of directories being searched$i$
  157. Asymptote searches for files it needs to open using your Search Paths file.  Select this 
  158. preference if you want to view the progress of the search.  You may find this useful if 
  159. Asymptote is unable to locate a file and you want to know what directories it has searched.  
  160. If youàd rather not be bothered with the details of the search, deselect this preference.
  161.  
  162. $i$Ask to save the Graph Windowàs contents when it is closed$i$
  163. Select this preference if you want to save your graph to a PICT file every time you close 
  164. the $i$Graph Window$i$.  For most circumstances, you donàt need to save the graph because 
  165. your Recorder script provides a complete record of how your graph was made.  You can 
  166. always run the Recorder to generate your graph again, but if you would like to have PICT 
  167. versions of all your graphs, select this preference.  When you select this preference, 
  168. Asymptote asks you if you want to save the contents of the $i$Graph Window$i$ if you close 
  169. the $i$Graph Window$i$ without saving the graph to a PICT file first.  You may want to save 
  170. your graphs to PICT files if you want to use them in other programs or if you are 
  171. creating complicated graphics that take a long time to draw from a script. 
  172.  
  173. ¥ Note:  You can save the current contents of the $i$Graph Window$i$ to a PICT file at anytime 
  174. by clicking the $i$Graph Window$i$ and selecting File Save˚As.
  175.  
  176. $i$Use the maximum printer resolution for the highest quality graphics$i$
  177. Select this preference if you want Asymptote to draw your graph on a high resolution 
  178. coordinate grid.  A high resolution grid (one with more dots per inch) produces the 
  179. highest quality output on your printer.  If you are creating graphs to use in another 
  180. application, you may need to experiment with the setting of this preference.  Most 
  181. drawing and desktop publishing programs can handle the high resolution graphics 
  182. Asymptote produces when you select this preference, but others cannot.  If you have 
  183. difficulty reading or pasting an Asymptote graph into another program, try 
  184. deselecting this preference.
  185. $$Memory Use
  186. menu command on the Options sub-menu
  187. To configure how Asymptote uses memory, select the $i$Memory Use$i$ item from 
  188. the $i$Options$i$ menu.  A dialog box lets you choose what settings Asymptote should 
  189. use the next time you launch it.  Here you can select how long to make Asymptote's 
  190. vectors and how many registers and stack elements you want.  For a detailed description
  191. of the Memory Use dialog, see Chapter 3 of the Asymptote $i$User's Guide$i$.
  192.  
  193. WOULD YOU LIKE TO PLOT MORE POINTS?
  194. Use the $i$Memory Use$i$ dialog box to lengthen Asymptote's x, y, p, or e vectors 
  195. so you can plot more points.  The next time Asymptote starts, it allocates 
  196. additional memory for the increased size of the data arrays.  If there isn't enough 
  197. memory to accommodate the larger vectors, Asymptote makes them as long as 
  198. possible.  
  199.  
  200. IS MEMORY LOW?
  201. If you find you are running low on memory try the following steps:
  202.    ¥ Close windows you are not using and save their contents.
  203.    ¥ On color Macintoshes, use the Monitors Control Panel to switch to 1 bit.
  204.    ¥ Allocate more memory to Asymptote in the Finder as described in the section titled 
  205.         ¼Using Memory½ of the $i$User's Guide$i$.
  206.    ¥ Select File>Options>Memory Use and reduce the number of registers you are using, 
  207.         or the depth of the vector calculator stack.
  208. Note:  If the amount of free memory is getting low, Asymptote does not maintain a 
  209. snapshot of the $i$Graph Window$i$.  If this happens, the $i$Graph Window$i$ may take much 
  210. longer to be drawn.  Free up some memory to improve performance.
  211.  
  212. ¥ Note: The $i$Status Window$i$ presents some useful information about your usage of memory.
  213. $$Search Paths
  214. menu command on the Options menu
  215. Asymptoteàs search paths lets you specify where Asymptote should look when  it needs to 
  216. open a script or a data file.  You store these paths in a Search Paths File.  When 
  217. Asymptote needs to locate a file to open, it automatically searches the paths for you.
  218.  
  219. To create a Search Paths File, type a set of search paths (one per line) into a Text Editor 
  220. Window and save the file in the same directory as Asymptote.  Then, select 
  221. File>Options>Search Paths File which tells Asymptote to use the new file.
  222.  
  223. You can change your search paths at any time by opening the Search Paths file in a 
  224. Text Editor Window.  If you have the current Search Paths file open in a Text Editor 
  225. Window, Asymptote uses the edited copy (rather than the one on disk) for the 
  226. search paths.
  227.  
  228. When Asymptote needs to open a file, it first looks in the Asymptote folder or in 
  229. the System Folder.  If Asymptote canàt find the file, it uses the search paths in the 
  230. current Search Paths File to locate the file.  The Search Paths File is a list of places 
  231. in which Asymptote looks for files.  Each line of the Search Paths File is a possible 
  232. ¾path nameà that identifies a particular file or group of files in your hard disk.  
  233. You can define either full or partial path names.  Full path names begin with the 
  234. name of the disk to search.  You can use them to locate a file on any disk in your 
  235. Macintosh desktop.  Partial path names, which begin with a colon, specify files or 
  236. folders in the Asymptote folder.
  237.  
  238. For example, if a file named ¾MyDataà is in a folder named ¾Testing,à which is in 
  239. the same folder as Asymptote, the partial path name of the file would be the following:
  240.     :Testing:MyData
  241. If the Asymptote folder were on a hard disk named ¾Smith,à the full path name to 
  242. the same file might be something like this:
  243.     Smith:Asymptote:Testing:MyData
  244.  
  245. $b$Using Wild Cards in the Search Paths File$b$
  246. The above examples specified search paths that matched files exactly.  To specify a 
  247. search path that can locate any number of files in any number of directories, use 
  248. the special characters, question mark (?) and asterisk (*).  A question mark in a 
  249. path name matches any single character.  An asterisk matches any number of characters.
  250. For example, the search path
  251.     Smith:Asymptote:Testing:MyData??
  252. matches any file in the folder Smith:Asymptote:Testing with the name MyData followed 
  253. by any two characters.  To locate files named MyData followed by any number of 
  254. characters, you could use the search path
  255.     Smith:Asymptote:Testing:MyData*
  256. or you could match any file in the directory Smith:Asymptote:Testing:MyData with 
  257. the search path
  258.     Smith:Asymptote:Testing:*
  259. Replace the name of a folder in a search path with a * to have Asymptote include 
  260. that folder and all of the folders inside it in the search path.  This gives you a 
  261. powerful way to search whole directory trees for files.  If you replace the disk 
  262. name in a search path with an asterisk, Asymptote searches all the disks on the 
  263. desktop.  Here are some examples:
  264.  
  265. Files with names ending in ¾.datà in the folder ¾My Data:Julyà on the disk ¾Data˚1à:
  266.     Data 1:My Data:July:*.dat
  267. Files ending in ¾.datà in any folder inside the folder ¾My Dataà:
  268.     Data 1:My Data:*:*.dat
  269. Files ending in ¾.datà in any folder on the disk ¾Data˚1à:
  270.     Data 1:*:*.dat
  271. Any file ending in ¾.datà on any disk on the desktop.
  272.     *:*.dat
  273. Files beginning with the letters ¾abcà in the Asymptote folder:
  274.     :abc*
  275. Files beginning with the letters ¾absà in any folder in the Asymptote folder:
  276.     :*:abc*
  277. All files in the Asymptote folder and all of the folders inside it:
  278.     :*:*
  279. Files beginning with the letter ¾zà in any folder that has ¾xyà as its third 
  280. and fourth characters followed by any number of characters:
  281.     :??xy*:z*
  282. $$Command Macros File
  283. menu command on the Options sub-menu
  284. Command macros are powerful way to streamline and configure Asymptote to suit you 
  285. and your needs.  When Asymptote begins processing a new command, either when it 
  286. reads the next line of a script or when you type a command in the $i$Command 
  287. Window$i$, it first searches the Command Macros File to see if there is a macro 
  288. with the given name.  If a macro is found it replaces the macro name with macro 
  289. definition leaving the rest of the command unchanged.  If a macro is not found, 
  290. Asymptote searches for a script with the same name as the command using the 
  291. current search paths (see $i$Search Paths$i$).
  292.  
  293. To choose the file you would like Asymptote to use for command macros, select the 
  294. $i$Command Macros$i$ menu command from the $i$Options$i$ menu.  Asymptote 
  295. asks you to select the macros file and uses that file until you select a new one.
  296.  
  297. WRITING COMMAND MACROS:
  298. A command macro must have the name of the macro as the first item in the line.  The 
  299. text of the macro should follow after that.  The text of the line can contain arguments 
  300. (&1, &2, &3, etc).  For example, the following macro:
  301.     stars    pointsymbol 5 filled
  302. sets the point style to filled 5 pointed stars every time you type 'stars' in the 
  303. $i$Command Window$i$ or whenever the command 'stars' is encountered in a 
  304. script.  Take a look at the file ¼Asymptote Macrosà for some examples.
  305.  
  306. COMMAND MACROS AS ONE LINE SCRIPTS:
  307. Command macros can also accept arguments.  For example the following macro in the 
  308. command macros file:
  309.     solidpts    pointsymbol &1 filled
  310. sets the pointsymbol to filled squares if you type:
  311.     solidpts 4
  312. in the Command Window or in another script.  Its sets the point style to filled 
  313. triangles if you use:
  314.     solidpts 3
  315. instead.  In this case the single argument to the macro ¾solidptsà is the number of 
  316. sides of the point.
  317.  
  318. USING COMMAND MACROS TO REDEFINE ASYMPTOTE COMMANDS:
  319. Another way to use command macros is to redefine Asymptote's commands to suit 
  320. your tastes.  You may not like the name of a particular command, you may want to 
  321. shorten a command so it is easier to type, or you may want to customize Asymptote 
  322. commands to look more like commands you are familiar with from other programs.  
  323. For example, to redefine the graphlimits command to be 'gl' use the macro:
  324.     gl    graphlimits
  325. Then the command
  326.     gl 1 10 -1 10
  327. has exactly the same effect as:
  328.     graphlimits 1 10 -1 10
  329. and it is much shorter to type.
  330.  
  331. ¥ Note: You can open and edit the Command Macros file while you are using 
  332. Asymptote.  As you make changes to the macros, Asymptote will use the new 
  333. definitions when it executes a macro.  There is no need to save the macros file and 
  334. restart Asymptote (the same is true for the Search Paths file, but not for the Help file).
  335. $$Edit Menu
  336. Using Menu Commands
  337. Menu Command                            Asymptote command
  338. $i$Undo...$i$
  339.     ± Undo the last change you made in a Text Editor Window
  340. $i$Cut...$i$
  341.     ± Cut the selected text to the clipboard
  342. $i$Copy...$i$
  343.     ± Copy the selected text to the clipboard
  344.     or
  345.     ± Copy the contents of the $i$Graph Window$i$ to the clipboard
  346. $i$Paste...$i$
  347.     ± Paste the clipboard text at the insertion point
  348. $i$Clear...$i$
  349.     ± Clear selected text
  350.     or
  351.     ± Clear the $i$Graph Window$i$                    $b$clear$b$
  352. $i$Create Publisher$i$
  353.     ± Create a new publisher of the $i$Graph Window$i$        $b$publish$b$
  354. $i$Subscribe To...$i$
  355.     ± Open a text edition in a Text Editor Window        $b$open$b$
  356. $i$Publisher/Subscriber Options...$i$
  357.     ± Set the options for a publisher or subscriber
  358. $$Search
  359. sub-menu under the Edit Menu
  360. Menu Command
  361. Search Menu:$i$
  362. $i$Find...$i$
  363.     ± Search from some text in one or more text files
  364. $i$Find Again$i$
  365.     ± Find the next occurrence of the search text 
  366. $i$Find in Next File$i$
  367.     ± Open the next file and find the next occurrence of the search text
  368. $$Replace
  369. sub-menu under the Edit Menu
  370. Menu Command
  371. $i$Selection$i$
  372.     ± Replace the selected text with the replacement text
  373. $i$and Find Again$i$
  374.     ± Replace the selected text and search again
  375. $i$All$i$
  376.     ± Replace all occurrences of the search text with the replacement text
  377. $$Go to
  378. sub-menu under the Edit Menu
  379. $i$Top$i$
  380.     ± Move the insertion point to the first line of a Text Editor Window
  381. $i$Bottom$i$
  382.     ± Move the insertion point to the last line of a Text Editor Window
  383. $i$Line #...$i$
  384.     ± Move the insertion point to a specified line number in a Text Editor Window
  385. $$Indent
  386. sub-menu under the Edit Menu
  387. $i$Left$i$
  388.     ± Indent the selected text to the left by one tab stop
  389. $i$Right$i$
  390.     ± Indent the selected text to the right by one tab stop
  391. $$Configure
  392. sub-menu under the Edit Menu
  393. $i$Font$i$
  394.     ± Choose a font for a Text Editor Window
  395. $i$Font Size$i$
  396.     ± Choose a font size for a Text Editor Window
  397. $i$Tab width...$i$
  398.     ± Choose the width for a Text Editor Window
  399. $i$Auto indent$i$
  400.     ± Auto indent when you press the Return key
  401. $$Data Menu
  402. Using Menu Commands
  403. Menu Command                            Asymptote command
  404. $i$Lines...$i$
  405.     ± Select which of the data file to use when reading data    $b$datalines$b$
  406. $i$Columns...$i$
  407.     ± Select the columns of the data file to read            $b$datacolumns$b$
  408. $i$Read x data...$i$
  409.     ± Read a row of the data file into the x vector        $b$readrow$b$ x
  410.     ± Read a column of the data file into then x vector        $b$readcolumn$b$ x
  411. $i$Read y data...$i$
  412.     ± Read a row of the data file into the y vector        $b$readrow$b$ y
  413.     ± Read a column of the data file into the y vector        $b$readcolumn$b$ y
  414. $i$Read point styles...$i$
  415.     ± Read a row of the data file into the p vector        $b$readrow$b$ p
  416.     ± Read a column of the data file into the p vector        $b$readcolumn$b$ p
  417. $i$Read e data...$i$
  418.     ± Read a row of the data file into the error vector        $b$readrow$b$ e
  419.     ± Read a column of the data file into the e vector        $b$readcolumn$b$ e
  420. $i$Read labels...$i$
  421.     ± Read a row of the data file into the l vector        $b$readrow$b$ l
  422.     ± Read a column of the data file into the l vector        $b$readcolumn$b$ l
  423. $i$Sort by X$i$
  424.     ± Sort all the vectors by the x vector            $b$sort$b$
  425. $i$Calculate...$i$
  426.     ± Activate the rpn calculator window            $b$rpn$b$
  427. $i$Bin X...$i$
  428.     ± Calculate the histogram of the values in the x vector     $b$binxy$b$
  429. $i$Smooth Y...$i$
  430.     ± Smooth the y data with a variable width window        $b$smooth$b$
  431. $i$Spline Y = f(x)...$i$
  432.     ± Fit a spline to the x,y data points                $b$spline$b$
  433. $i$Fit Y = a + b*X...$i$
  434.     ± Fit a polynomial to the x,y data                    $b$fit$b$
  435. $i$# of points...$i$
  436.     ± Set the lengths of the x,y,e,p, l vectors            $b$npts$b$
  437. $$Set Menu
  438. Using Menu Commands
  439. Menu Command                            Asymptote command
  440. $i$Graph$i$
  441.     ± Set the x and y limits of the graph frame            $b$graphlimits$b$
  442.     ± Set the spacing of axis tick marks                $b$graphticks$b$
  443.     ± Set the position of the graph in the page            $b$graphframe$b$
  444.     ± Set the aspect ratio of the graph on the page        $b$graphaspect$b$
  445. $i$Pen$i$
  446.     ± Set the pen:
  447.         size                            $b$pensize$b$
  448.         color                            $b$pencolor$b$
  449.         transfer mode                         $b$penmode$b$
  450.         pattern                        $b$penpattern$b$
  451.         dash pattern                        $b$pendash$b$
  452. $i$Background
  453.     ± Choose a background color for the $i$Graph Window$i$        $b$backcolor$b$
  454. $i$Fill pattern$i$
  455.     ± Set the fill pattern for points and polygons        $b$fillpattern$b$
  456. $i$Point Symbol$i$
  457.     ± Set the symbol to draw at each point            $b$pointsymbol$b$
  458. $i$Point Size$i$
  459.     ± Set default size for point symbols                $b$pointsize$b$
  460. $i$Tick Size$i$
  461.     ± Set the default size for major tick marks            $b$ticksize$b$
  462. $i$Scale Factor$i$
  463.     ± Set the scale factor for points, tick marks and text    $b$scale$b$
  464. $i$Rotation$i$
  465.     ± Set the rotation angle of the graphics environment    $b$rotation$b$
  466. $i$Font$i$
  467.     ± Change the font for the $i$Graph Window$i$            $b$fontname$b$
  468. $i$Font Size$i$
  469.     ± Set the default size for labels                $b$fontsize$b$
  470. $i$Text Mode$i$
  471.     ± Set the transfer mode for text                $b$textmode$b$
  472. $i$Notation$i$
  473.     ± Set the notation format for labels and tick marks        $b$notation$b$
  474. $i$Digits$i$
  475.     ± Set how many digits to use for labels and ticks        $b$digits$b$
  476. $i$Variable$i$
  477.     ± Set or change the value of a variable            $b$set$b$
  478. $$Plot Menu
  479. Using Menu Commands
  480. Menu Command                            Asymptote command
  481. $i$Clear...$i$
  482.     ± Clear the graph                        $b$clear$b$
  483. $i$Zoom In/Out$i$
  484.     ± Zoom the graph to show more or less detail        $b$zoomgraph$b$
  485. $i$Show Graph$i$                            
  486.     ± Zoom to show the graph frame                $b$showgraph$b$
  487. $i$Show Page$i$
  488.     ± Zoom to show the entire page                $b$showpage$b$
  489. $i$Full Screen$i$
  490.     ± Turn full screen mode on and off                $b$fullscreen$b$
  491. $i$Cursor$i$
  492.     ± Activate the graph cursor                    $b$cursor$b$
  493. $i$Points$i$
  494.     ± Plot the x,y data as individual points            $b$plotpoints$b$
  495. $i$Errors$i$
  496.     ± Plot error bars on the x,y points                $b$ploterrors$b$
  497. $i$Line$i$
  498.     ± Plot the x,y data a line                    $b$plotline$b$
  499. $i$Arrows$i$
  500.     ± Plot arrows between pairs of points            $b$plotarrows$b$
  501. $i$Histogram$i$
  502.     ± Plot the x,y data as a histogram                $b$plothistogram$b$
  503. $i$Polygon$i$
  504.     ± Connect the x,y points to make a polygon            $b$plotpolygon$b$
  505. $i$Labels...$i$
  506.     ± Plot labels at each of the x,y data points            $b$plotlabels$b$
  507. $$Draw Menu
  508. Using Menu Commands
  509. Menu Command                            Asymptote command
  510. $i$Frame...$i$
  511.     ± Draw a frame around the graph                $b$drawframe$b$
  512. $i$Grid...$i$
  513.     ± Draw grid lines                        $b$drawgrid$b$
  514. $i$Axis...$i$
  515.     ± Draw an axis on one side of the graph frame        $b$drawaxis$b$
  516. $i$Title...$i$
  517.     ± Draw a title centered above the graph frame        $b$drawtitle$b$
  518. $i$X Label...$i$
  519.     ± Draw a label on the x axis of the graph            $b$drawxlabel$b$
  520. $i$Y Label...$i$
  521.     ± Draw a label on the y axis of the graph            $b$drawylabel$b$
  522. $i$Label...$i$
  523.     ± Draw a label at the current pen position            $b$drawlabel$b$
  524. $i$Move to...$i$
  525.     ± Move the pen to a new x,y location                 $b$moveto$b$
  526. $i$Draw to...$i$
  527.     ± Draw a line from the current pen position to 
  528.         a new x,y position                    $b$drawto$b$
  529. $i$Arrow to...$i$
  530.     ± Draw an arrow from the current pen position to 
  531.         a new x,y position                    $b$drawarrowto$b$
  532. $i$Point$i$
  533.     ± Draw a point on the graph                    $b$drawpoint$b$
  534. $i$Clip To Frame$i$
  535.     ± Select whether to allow drawing outsize the 
  536.         graph frame or not                    $b$cliptoframe$b$
  537. $$Window Menu
  538. Using Menu Commands
  539. Menu Command                            Asymptote command
  540. $i$Graph$i$
  541.     ± Bring the $i$Graph Window$i$ to the top        
  542. $i$Command$i$
  543.     ± Bring the Command Window to the top        
  544. $i$Calculator$i$
  545.     ± Bring the RPN window to the top                $b$rpn$b$
  546. $i$Vectors$i$
  547.     ± Bring the vectors window to the top        
  548. $i$Variables$i$
  549.     ± Bring the variables window to the top        
  550. $i$Status$i$
  551.     ± Bring the status window to the top
  552. $i$Help$i$
  553.     ± Bring this help window to the top                $b$help$b$
  554.  
  555. ¥ Use the other items on this menu to select a file in a Text Editor Window.
  556. $$Script Menu
  557. Using Menu Commands
  558. Menu Command                            Asymptote command
  559. $i$Run Recorder$i$                        
  560.     ± Start executing the current $i$Recorder Window$i$        $b$run$b$
  561. $i$Run Active Window$i$                    
  562.     ± Run the script in the active window
  563. $i$Run Selection$i$                    
  564.     ± Run selected lines in the active window
  565. $i$Pause$i$                    
  566.     ± Pause on the currently executing command        $b$pause$b$
  567. $i$Step$i$                    
  568.     ± Execute the next command in the current script
  569. $i$Stop$i$                    
  570.     ± Stop running a script                    $b$stop$b$
  571. $i$Trace$i$                    
  572.     ± Trace the execution of scripts as they execute        $b$trace$b$
  573. $i$Trace$i$                    
  574.     ± Trace the execution of scripts as they execute        $b$trace$b$
  575. $i$Add Commands$i$                    
  576.     ± Select whether to add commands at the end of the
  577.     $i$Recorder Window$i$ or at the insertion point
  578.     ¥ See also:$i$Preferences$i$
  579. $$Movie Menu
  580. Using Menu Commands
  581. Menu Command                            Asymptote command
  582. $i$New...$i$                        
  583.     ± Create a new, empty movie in the $i$Movie Window$i$        $b$moviefile$b$
  584. $i$Open...$i$                    
  585.     ± Open an existing movie file in the $i$Movie Window$i$        $b$moviefile$b$
  586. $i$Add Frame$i$                    
  587.     ± Copy the $i$Graph Window$i$ to a new movie frame        $b$movieframe$b$
  588. $i$Loop$i$                    
  589.     ± Repeat the movie when it finishes playing
  590. $i$Loop Back and Forth$i$                    
  591.     ± Reverse the movie when it finishes playing
  592. $i$Faster$i$                    
  593.     ± Increase the speed of the movie
  594. $i$Slower$i$                    
  595.     ± Decrease the speed of the movie
  596. $$Recorder Menu
  597. sub-menu under the File Menu
  598. Menu Command                            Asymptote command
  599. $i$New Recorder...$i$
  600.     ± Open a new Text Editor and make it the Recorder
  601. $i$Open As Recorder...$i$
  602.     ± Open an existing text file and make it the Recorder    $b$recorder$b$
  603.  
  604. To make a different window to be the recorder, simply select 
  605. its name on this menu.
  606.  
  607. ¥ The current $i$Recorder Window$i$ (if any) has a microphone 
  608. icon next to its name.
  609.  
  610. See also:$i$Recorder Window$i$
  611. $$Data
  612. sub-menu under the File Menu
  613. Menu Command                            Asymptote command
  614. $i$New Data...$i$
  615.     ± Open a new window as the $i$Data Window$i$
  616. $i$Open As Data...$i$
  617.     ± Open an existing text file and make it             $b$datafile$b$
  618.         the $i$Data Window$i$
  619.  
  620. To make a different window to be the $i$Data Window$i$, simply 
  621. select its name on this menu.
  622.  
  623. ¥ The current $i$Data Window$i$ (if any) has an icon with the numbers 
  624. 1,2,3 next to its name.
  625.  
  626. See also:$i$Data Window$i$
  627. $$Recorder Window
  628. Asymptote Windows
  629. The Recorder is a special text editing window that logs all the commands you use 
  630. to make your graph.  As you work in Asymptote, whether you are selecting menu 
  631. commands or typing commands, the $i$Recorder Window$i$ saves a record of what you have 
  632. done.  This record is a script that describes all the steps necessary to draw 
  633. your graph.  To run the script in the $i$Recorder Window$i$ select $i$Run˚Recorder$i$.  
  634. When you have finished making a graph, save the $i$Recorder Window$i$ script to a file.  
  635. You can run this script when you want to recreate the graph  in the future.
  636. To plot different data or to fine tune the appearance of your graph, you can edit 
  637. the script in the Recorder Window.  To draw the revised graph select 
  638. Script>Run˚Recorder.  To learn more about writing scripts, turn to Chapter 6.
  639.  
  640. Selecting the $i$Recorder Window$i$:
  641. You can identify the $i$Recorder Window$i$ by looking for the microphone symbol 
  642. in the $i$Window menu$i$.  Use the $i$Recorder Menu$i$ to make a different window the
  643. $i$Recorder Window$i$ or to open a new recorder.  See the description of the $i$Recorder Menu$i$ 
  644. for more information.
  645. $$Data Window
  646. Asymptote Windows
  647. The $i$Data Window$i$ is the window Asymptote uses when reading data.
  648.  
  649. The current $i$Data Window$i$, if one is open, is identified on the $i$Windows Menu$i$ 
  650. by a symbol with numbers 1,2,3 on it.  To make a different window the $i$Data Window$i$,
  651. select its name from the $i$Data Menu$i$.  You can also use the $i$Data$i$ menu to 
  652. open a new Text Editor Window as the $i$Data Window$i$.
  653.  
  654. SEE ALSO:
  655. $i$Reading Data$i$ 
  656. $b$datafile$b$ 
  657. $$Graph Window
  658. Asymptote Windows
  659. The $i$Graph Window$i$ is where Asymptote creates your graph.
  660.  
  661. To zoom the graph to show more detail, move the mouse to the $i$Graph Window$i$, hold 
  662. down the command key and click on the portion of the graph that you want to see in 
  663. more detail.
  664.  
  665. To zoom out, hold down the command and options keys together and click anywhere in 
  666. the $i$Graph Window$i$.
  667.  
  668. To print your graph select $i$Print Graph$i$ from the $i$File$i$ menu or type $b$print$b$ in the 
  669. $i$Command Window$i$.
  670. $$Status Window
  671. Asymptote Windows
  672. The $i$Status Window$i$ keeps you informed about what Asymptote is doing, and provides 
  673. valuable information about the state of your session with Asymptote.  Use the 
  674. $i$Status Window$i$ to check on the value of a variable in the $i$graphics environment$i$, 
  675. to see which data file is open, or to check the value of a user variable.  The 
  676. $i$Status Window$i$ is particularly valuable when you are debugging a script (see 
  677. Chapter 6).  While you are executing a script in Asymptote, the title of the 
  678. $i$Status Window$i$ changes to let you know the line number and the name of the script 
  679. that is running.
  680.  
  681. The items in the $i$Status Window$i$ are separated into groups.  Most of these items 
  682. are either variables in the $i$graphics environment$i$ or Asymptote variables.  Variable 
  683. names appear in the column on the right.
  684.  
  685. SEE ALSO:
  686. $i$Variables & Constants$i$
  687. $i$graphics environment$i$
  688. $$Vectors Window
  689. Asymptote Windows
  690. Use the $i$Vectors Window$i$ to quickly the view the status of Asymptote's vectors.
  691.  
  692. Click on the black triangles at the top of each column to select which vectors you
  693. want to view.
  694.  
  695. Click on the scroll bar at the side of the $i$Vectors Window$i$ to scroll through the all the 
  696. elements of the vectors you are viewing.
  697.  
  698. The $i$Preferences$i$ dialog box allows you to suspend updates of the $i$Vectors Window$i$
  699. while your scripts are executing.  This makes scripts run faster.  When your script 
  700. stops running or is paused Asymptote redraws the $i$Vectors Window$i$.
  701. $$Command Window
  702. Asymptote Windows
  703. Sometimes typing a command is faster than selecting menus and responding to dialog 
  704. boxes.  After you type a command in the $i$Command Window$i$ press Return or Enter.  
  705. Asymptote executes the command and saves it to the current $i$Recorder Window$i$ (if one 
  706. is open).  To edit the command before you press Return, click the text with the mouse 
  707. or press the left or right arrow keys.
  708.  
  709. The up and down arrow keys have a special purpose in the $i$Command Window$i$.  If you 
  710. press the up arrow while the Command Window is active, Asymptote brings the 
  711. current $i$Recorder Window$i$ to the front.  Press the down arrow key while the 
  712. $i$Recorder Window$i$ is active to bring the $i$Command Window$i$ to the front.
  713.  
  714. Note that when you issue a command in the $i$Command Window$i$ using '?' for its 
  715. arguments, Asymptote gets the values for the arguments from you interactively 
  716. using dialog boxes or the graph cursor.  It then records the command in the recorder 
  717. window with the values 'filled-in'.  This is a convenient way to enter a command if 
  718. you don't remember what the arguments to the command are or if you don't 
  719. remember their proper order.
  720.  
  721. You can also use '?' to read coordinates from the graph.  For example if you type:
  722.     moveto ?
  723. in the $i$Command Window$i$, Asymptote activates the graph cursor, gets the new x,y 
  724. position when you click the mouse, and then enters the $b$moveto$b$ command at the end of 
  725. the recorder with the x,y coordinates filled in.  If you clicked on (3.292,29.9) in 
  726. graph coordinates, Asymptote enters the command:
  727.     moveto 3.292 29.9
  728. in your recorder.
  729.  
  730. If you always want to be prompted for the x,y coordinates for the moveto command 
  731. every time your script executes, then put
  732.     moveto ?
  733. directly into your script (don't type it in the $i$Command Window$i$).  Every time 
  734. Asymptote encounters this command it activates the cursor and gets the new x,y 
  735. position from you using the mouse.
  736. $$Variables Window
  737. Asymptote Windows
  738. The $i$Variables Window$i$ is a list of all the variables and their current values.  The 
  739. variable name appears in the left column, while the right column contains the 
  740. current value of the variable.  As you create new variables they appear at the 
  741. bottom of the list.
  742.  
  743. To change a user variable use the $b$set$b$ command.
  744.  
  745. SEE ALSO:
  746. $i$graphics environment$i$
  747. $i$Variables & Constants$i$
  748. $$Vectors Window
  749. Asymptote Windows
  750. Use the $i$Vectors Window$i$ to examine the contents of Asymptoteàs vectors.  Click the 
  751. black triangles at the top of each column to pop-up a menu.  Use the pop-up menu to 
  752. select the vector you want to view in each column. 
  753.  
  754. For convenience you can select Show Stack from the pop-up menu to have Asymptote 
  755. display the current contents of the calculator stack.  Showing the stack in the 
  756. $i$Vectors Window$i$ is very useful when you are debugging $b$rpn$b$ calculations.
  757.  
  758. SEE ALSO:
  759. $b$rpn$b$
  760. $i$Reading Data$i$
  761. $$Calculator Window
  762. Asymptote Windows
  763. You can write expressions for Asymptoteàs vector calculator with the 
  764. $i$Calculator Window$i$.  Simply click the various buttons in the calculator and Asymptote 
  765. calculates the result.  It also stores the appropriate $b$rpn$b$ command in your Recorder, 
  766. giving you a complete record of your calculation which you can play back later.  
  767.  
  768. If you are not familiar with reverse polish notation, see Appendix˚D of the $i$Users Guide$i$.
  769.  
  770. SEE ALSO:
  771. $b$rpn$b$
  772. $$Variables Window
  773. Asymptote Windows
  774. The $i$Variables Window$i$ is a list of all the variables with their current values.  
  775. The variable name appears in the left column, while the right column contains the 
  776. current value of the variable.  As you create new user variables they appear at the 
  777. bottom of the list.  To change a user variable use the $b$set$b$ command.
  778.  
  779. SEE ALSO:
  780. $i$Variables & Constants$i$
  781. $b$set$b$
  782. $$Movie Window
  783. Asymptote Windows
  784. The $i$Movie Window$i$ lets you view QuickTime movies.  The controls at the bottom
  785. of the $i$Movie Window$i$ let you play a movie or step through its frames one at 
  786. a time.  See the description of the $i$Movie Menu$i$ for more information about
  787. playing movies
  788.  
  789. SEE ALSO:
  790. $i$Movie Menu$i$
  791. $b$moviefile$b$  $b$movieframe$b$
  792. $$areaxy
  793.  
  794. Calculate the area under the curve y = f(x) 
  795.  
  796. ARGUMENTS: 
  797. none
  798.  
  799. DESCRIPTION: 
  800. Use $b$areaxy$b$ to calculate the integrated area under the curve $i$y$i$= f($i$x$i$) using the
  801. trapezoidal rule.  Asymptote stores the result in the user variable $i$area$i$.
  802.  
  803. If you want to have more accuracy in the area calculation, consider first using $b$spline$b$ 
  804. to interpolate the curve with more ($i$x$i$, $i$y$i$) data points.
  805.  
  806. Asymptote uses all the ($i$x$i$,$i$y$i$) data points to calculate the area.  This means that points
  807. in the $i$x$i$ and $i$y$i$ arrays (including those outside your graph limits) will be  used in
  808. the area calculation.  If you don't want to include some of the ($i$x$i$,$i$y$i$) points in the area
  809. calculation, set their $i$y$i$ values to zero using the $b$rpn$b$ command as in the example below
  810.  
  811. SEE ALSO:
  812. $b$spline$b$
  813.  
  814. EXAMPLES:
  815. readcol y 3
  816. readcol x 2
  817. areaxy                % find the area under to curve and store in $i$area$i$
  818. drawlabel left Area = \area     % print the result on the graph
  819.  
  820. % Find the area for X between 10 and 100:
  821. rpn <x 10 > <x 100 < + <y * >y    % set y to zero if X < 10 or X > 100
  822. areaxy                    % calculate the area
  823. drawtitle Area for points with 10 < X < 100 = \area
  824. $$ask
  825. variableName trueText falseText query
  826. Ask the user for a true or false response and store the result in a user variable 
  827.  
  828. ARGUMENTS: 
  829. variableName        ± the name of a user variable to set
  830. trueText        ± text for the true (result = 1) button
  831. falseText        ± text for the false (result = 0) button
  832. query            ± the question to ask
  833.  
  834. DESCRIPTION: 
  835. Use $b$ask$b$ to display a dialog box that asks a yes/no (true/false) question.  Asymptote 
  836. stores the response to the question in a user variable.  You might use $b$ask$b$ to control 
  837. the execution of a script by asking a plain English question such as ¼Do you want to plot 
  838. another data file½ or ¼Plot the best fit model on top of the data?½.
  839.  
  840. You can also use the $b$ask$b$ to have Asymptote display a dialog box that has only a single
  841. button response.  You might use such a dialog box to alert the user to some condition or 
  842. provide them with some information while a script is running.  To hide one of the buttons,
  843. specify " " for its name.  If you hide one of the buttons, the other button is made the
  844. default response.  You can't hide both buttons.  Here's and example of using the $b$ask$
  845. command to display a one button dialog that lets the user know what to do when the graph 
  846. cursor is activated with the 'moveto ?' command that follows.
  847.     ask OK " " Please click on the point with the graph cursor.
  848.     moveto ?
  849.  
  850. SEE ALSO:
  851. $b$set$b$
  852. $b$if$b$ $b$repeat$b$ $b$while$b$
  853.  
  854. EXAMPLES:
  855. set continue true                % set the default response to ¾trueà (1)
  856. ask continue Yes No Do you want to continue?
  857. if continue false  = then stop
  858.  
  859. set PlotOnTop true
  860. ask PlotOnTop "On Top" "Erase first" Plot the next curve on top of the last?
  861. if PlotOnTop false  = then clear else plotline
  862.  
  863. set DoQuit false
  864. ask DoQuit "Yes, exit to finder" "No, don't quit" Would you like to quit?
  865. if DoQuit then quit
  866.  
  867. ask Normalize "Normalize Y" No Normalize the y data to its maximum?
  868. if Normalize then rpn <y max / >y
  869. $$backcolor
  870. r g b OR colorName
  871. Set the background color of the $i$Graph Window$i$
  872.  
  873. ARGUMENTS: 
  874. r, g, b        ± red green blue color values in percent (0 to 100) 
  875. or
  876. colorName    ± the name of a color (red, green, blue, magenta,             
  877.             yellow, purple, black, white)
  878.  
  879. DESCRIPTION: 
  880. Use $b$backcolor$b$ to change the background color of the $i$Graph Window$i$.  The $b$backcolor$b$
  881. command is especially useful when you are taking pictures of the screen or when you
  882. are making a presentation.  You can use$b$backcolor$b$ to choose the background color
  883. and then $b$fullscreen$b$to expand the $i$Graph Window$i$ to fill the screen.
  884.  
  885. To choose a color interactively type
  886.     backcolor ?
  887. in the $i$Command Window$i$. 
  888.  
  889. SEE ALSO:
  890. $b$fullscreen$b$
  891.  
  892. EXAMPLES:
  893. backcolor 80 80 80    % set the background color to light gray
  894. pencolor black
  895. drawframe        % draw a black frame on the gray background
  896.  
  897. backcolor black    % set the background color to back
  898. pencolor white    % set the pen color to white
  899. myscript        % run my script and draw a white graph on black
  900. fullscreen on        % expand the graph to fill the screen
  901.  
  902. backcolor 10 90 25    % set the background to a particular color
  903.  
  904. backcolor ?        % Choose a color using a color wheel.  Put this command
  905.             % in a script to open the color wheel each time you run
  906.             % the script.
  907.             % Type this command in the $i$Command Window$i$, select the
  908.             % color from a color wheel and Asymptote records the
  909.             % appropriate backcolor command for you in the Recorder.
  910. $$binxy
  911. nbins [ operation [ xstart xend ] ]
  912. Bin the x, y data into equally spaced bins
  913.  
  914. ARGUMENTS: 
  915. nbins        ± number of bins to calculate
  916. operation    ± the operation to perform for each bin:
  917.     count (=0)     => count the number of points in each bin
  918.     average(=1)     => average the $i$y$i$ values that fall in each bin
  919.     sum (=2)    => sum the $i$y$i$ values that fall in each bin
  920. xstart        ± x value for the start of the first bin
  921. xend        ± x value for the end of the last bin
  922.  
  923. DESCRIPTION: 
  924. Use $b$binxy$b$ to calculate the histogram of the $i$y$i$ data values.  Although $b$binxy$b$ accepts up to
  925. four arguments, you must supply on the first argument (nbins), the number of bins to
  926. calculate.   The second argument, is the operation to perform on each bin (operation),
  927. and the third and fourth arguments are the smallest and largest $i$x$i$ values you want
  928. binned (xstart, xend).
  929.  
  930. If you don't specify the operation, Asymptote  simply counts the number of points that
  931. fall into each bin (for example a frequency distribution).  If you donàt specify xstart
  932. and xend, $b$binxy$b$ uses the current graph limits (xleft and xright) for xstart and
  933. xend (see $b$graphlimits$b$).
  934.  
  935. When $b$binxy$b$ executes, it goes through the ($i$x$i$, $i$y$i$) data points one by one.  First it
  936. uses the $i$x$i$ value of the point to determine what bin needs to be modified.  Then, $b$binxy$b$
  937. uses the $i$y$i$ value of the point to update the value in the bin.  What Asymptote calculates
  938. depends on the operation you specify.  If the operation is 'count' (=0) Asymptote simply
  939. counts the number of points that fall into each bin.  For 'average' (=1) and 'sum' (=2)
  940. Asymptote calculates the average or sum of the points that fall in each bin.  After all the
  941. ($i$x$i$,$i$y$i$) points have been processed, Asymptote replaces the $i$x$i$ values with the $i$x$i$
  942. values of the bin centers, stores the bin values in the $i$y$i$ vector and sets the number
  943. of points to the number of bins.  Although you can use any plot command to plot the bin
  944. values, $b$plothistogram$b$ produces a skyline-like plot that reflects the fact that the
  945. data have been binned.
  946.  
  947. Remember that $b$binxy$b$ uses both the $i$x$i$ and $i$y$i$ values when you specify  ¾averageà and
  948. ¾sum.à  If you want to calculate a sum or average histogram for the $i$x$i$ values only,
  949. use $b$rpn$b$ to copy the $i$x$i$ vector into the $i$y$i$ vector before you use $b$binxy$b$ to calculate
  950. the histogram (see the example below).
  951.  
  952. SEE ALSO:
  953. $b$plothistogram$b$
  954. $b$graphlimits$b$
  955.  
  956. EXAMPLES:
  957. readcol x 4
  958. readcol y 5
  959. graphlimits            % Set the limits to show all points
  960. binxy 100 sum        % Sum the y values of the points in to 100 bins in x
  961. graphlimits            % Set the limits to show all bins
  962. plothistogram            % plot the bins as a histogram
  963.  
  964. binxy 50 count 10.2  12.3    % Count the number of x values that fall into
  965.                 % 50 bins ranging from 10.2 to 12.3 in x
  966.  
  967. binxy    ?            % Ask for the bin parameters interactively
  968. $$clear
  969.  
  970. Clear the graph and release the memory it occupies
  971.  
  972. ARGUMENTS: 
  973. none
  974.  
  975. DESCRIPTION: 
  976. When you select $b$clear$b$, Asymptote erases the $i$Graph Window$i$ and frees the memory 
  977. used by the graph.
  978.  
  979. If you like, you can use File>Options>Preferences to have Asymptote erase the graph 
  980. automatically whenever you run the script in the $i$Recorder Window$i$.
  981.  
  982. SEE ALSO:
  983. $i$Preferences$i$
  984. $$cliptoframe
  985. [ value ]
  986. Choose whether to clip drawing to the graph frame or not
  987.  
  988. ARGUMENTS: 
  989. value    ± if $i$true$i$ then clip drawing to the graph frame
  990.         else allow drawing outside the frame
  991.  
  992. DESCRIPTION: 
  993. Use $b$cliptoframe$b$ to control whether Asymptote clips (truncates) all drawing to the 
  994. interior of the graph frame.  Set $b$cliptoframe$b$ to false if you want lines, labels and 
  995. points to extend outside the graph frame.  If you donàt specify the single argument to 
  996. $b$cliptoframe$b$, Asymptote sets $b$cliptoframe$b$ to true.
  997.  
  998. Most of the time you will want to have $b$cliptoframe$b$ set to true.  If you want to 
  999. annotate your graph with labels or arrows that extend outside the frame, set 
  1000. $b$cliptoframe$b$ to false then draw your annotations (see the example below).
  1001.  
  1002. SEE ALSO:
  1003. $i$Preferences$i$
  1004.  
  1005. EXAMPLES:
  1006. cliptoframe false    % donàt clip all subsequent drawing to the frame
  1007.  
  1008. cliptoframe                % set clip to frame to true
  1009. plotline                % plot a line which is clipped to the frame limits
  1010. moveto xright 10 + ytop 10 +    % move to a position just outside the frame
  1011. cliptoframe false              % make it possible to draw outside the frame
  1012. drawlabel centerright This is an interesting point!
  1013. moveto xright 10 + ytop 10 +    % move the pen in front of the label
  1014. drawarrowto x(10) y(10)        % draw an arrow pointing  to the 10th point
  1015. $$closewindow
  1016. [ windowname ]
  1017. Close a window and release the memory it occupies
  1018.  
  1019. ARGUMENTS: 
  1020. windowname    ± the name of the window to close
  1021.  
  1022. DESCRIPTION: 
  1023. Use $b$closewindow$b$ in a script to close a window when it is no longer needed.  If you 
  1024. donàt supply the name of the window to close, Asymptote closes the currently running 
  1025. script.
  1026.  
  1027. Closing windows frees up memory and reduces screen clutter.  With $b$closewindow$b$, 
  1028. your scripts can close windows automatically when they are no longer needed.  For 
  1029. example, you might write a script that opens a large file in the $i$Data Window$i$, reads
  1030. values from the file into the $i$x$i$ and $i$y$i$ vectors, then closes the $i$Data Window$i$
  1031. to free up the memory it occupies.
  1032.  
  1033. You can also put $b$closewindow$b$ at the end of a script to close it automatically after it 
  1034. finishes running.  This is particularly useful at the end of the ¾Asymptote Startup Scriptà
  1035. or in any script that performs a task and is no longer needed.
  1036.  
  1037. ¥ Note: If you want to hide a window on screen but keep its contents loaded in memory, 
  1038. use $b$hidewindow$b$ rather than $b$closewindow$b$.  A hidden window still appears in the
  1039. Windows menu where you can select its name and make it visible again.  See 
  1040. $b$hidewindow$b$ for more details.
  1041.  
  1042. SEE ALSO:
  1043. $i$Startup Script$i$
  1044. $b$hidewindow$b$ $b$showwindow$b$ 
  1045.  
  1046. EXAMPLES:
  1047. close March1988 data    % close the window "March 1988 data"
  1048.  
  1049. close \f            % close the current data file
  1050.  
  1051. close                % close this window
  1052. $$cursor
  1053.  
  1054. Activate the graph cursor and read values from the graph
  1055.  
  1056. ARGUMENTS: 
  1057. none
  1058.  
  1059. DESCRIPTION: 
  1060. Use $b$cursor$b$ to activate the $i$Graph Window$i$ cursor and read information from your 
  1061. graph.  Asymptote activates the $i$Graph Window$i$ and draws cross-hairs attached to the 
  1062. cursor.  As you move the mouse Asymptote displays the current cursor position and the 
  1063. difference between that position and the current position of the pen.  Click the mouse to 
  1064. make the cursor disappear.  
  1065.  
  1066. Note that $b$cursor$b$ does not move the pen.  Use the $b$moveto$b$ command if you 
  1067. want to use the graph cursor to move the pen.
  1068.  
  1069. SEE ALSO:
  1070. $b$moveto$b$
  1071. $$datacolumns
  1072. [ startcolumn [ endcolumn ] ]
  1073. Specify what columns or characters to read from the data file 
  1074.  
  1075. ARGUMENTS: 
  1076. startcolumn    ± first column or character to read from each line
  1077. endcolumn    ± last column or character to read from each line
  1078.  
  1079. DESCRIPTION: 
  1080. To specify the which columns you want to read from your data file, use the 
  1081. $b$datacolumns$b$ command.  After you specify which columns of your data file you 
  1082. want to read, use $b$readcolumn$b$ or $b$readrow$b$ to actually read the data into 
  1083. Asymptoteàs vectors.
  1084.  
  1085. To read data from all columns of your data file, execute $b$datacolumns$b$ with no 
  1086. arguments.  If you specify the first argument, startcolumn, Asymptote reads from that 
  1087. column to the last column in each row of your data file.  To specify both the starting and 
  1088. ending columns to read, supply both arguments to the $b$datacolumns$b$ command.
  1089.  
  1090. The two ways to use $b$datacolumns$b$ are described below:
  1091.  
  1092. READING FROM ROWS :
  1093.  
  1094. When you are using $b$readrow$b$ to read your data, the $b$datacolumns$b$ command tells
  1095. Asymptote which columns of the data file to read.  Asymptote looks for any number of 
  1096. white space characters (spaces or tabs) to identify separate columns in your data file.
  1097.  
  1098. For example, if row 10 of the data file looked like this:
  1099.  123.2     12E34    23  45.6   34   99.202   -20.083  "a label" 
  1100. And you wanted to read the values
  1101.     23  45.6  34
  1102. from the 3rd, 4th and 5th columns into the $i$y$i$ vector, you would issue these commands:
  1103. datacolumns 3 5    % select columns 3 through 5 inclusive
  1104. readrow y  10        % read the three values from row 10 and store them in y
  1105.  
  1106. READING FROM COLUMNS:
  1107.  
  1108. When used in conjunction with the $b$readcolumn$b$ command, the $b$datacolumns$b$ 
  1109. command tells Asymptote which $i$characters$i$ of each line to use when reading data.   
  1110. Normally the columns of your data file will be separated by spaces or tabs and it will not
  1111. be necessary to use $b$datacolumns$b$ when reading from columns of a file.  If the values
  1112. in your data file are run together without spaces or tabs to separate them, use 
  1113. $b$datacolumns$b$ to identify which characters of each line you want to read.
  1114.  
  1115. For example, if a portion of your data file looked like this:
  1116. FREQ=12.25E+13 TEMP=125 RIN=98 514.2 
  1117. FREQ=12.29E+13 TEMP=116 RIN=89 746.4 
  1118. FREQ=12.33E+13 TEMP=137 RIN=56 982.2
  1119. And you wanted to read the values
  1120.     125  116  and 137
  1121. which appear in characters 20 through 22 of each line, issue the commands:
  1122. datacolumns 20 22     % tell Asymptote to ignore all but characters
  1123.             %    20 through 12 of each line
  1124.  
  1125. readcolumn y 1    % read the first value (starting at character 10)
  1126.             % into the e vector
  1127.  
  1128. Notice that this example uses 1 for the column number for the $b$readcolumn$b$ 
  1129. command.  This is because when you use $b$datacolumns$b$ to specify which 
  1130. $i$characters$i$ to use in each line, Asymptote $i$ignores all the other characters in the 
  1131. line$i$.  Asymptote sees each line as beginning and ending with the characters you specify 
  1132. in the $b$datacolumns$b$ command.  Therefore, you can use the  $b$datacolumns$b$ 
  1133. command to mask out all but the characters you want to read.
  1134.  
  1135. Note:  To help you count characters in a line, use Edit>Configure to select a monospaced 
  1136. font (for example, Courier or Monaco) rather than a proportionally spaced font for your 
  1137. data file.  When you use a mono-spaced font, the characters in each line are the same
  1138. width making them easier to count.
  1139.  
  1140. SEE ALSO:
  1141. $b$datalines$b$ $b$datafile$b$
  1142. $b$readcolumn$b$  $b$readrow$b$ 
  1143.  
  1144. EXAMPLES:
  1145. datacolumns 3 20        % use columns 3 through 20
  1146. readrow x 10            % read the values in columns 3 though 20 of line 10 
  1147.                 %  into the x vector.
  1148.  
  1149. datalines 1 13            % read from lines 1 through 13
  1150. datacolumns 10 34        % ignore all but characters 10 through 34 of each line
  1151. readcolumn x 2        % read the 2nd item starting with character 10 of each line
  1152.                 % and store in x
  1153.  
  1154. datacolumns 4            % Skip the first 3 columns and read to the end of each line
  1155.  
  1156. datacolumns            % use all columns (or characters) when reading data.
  1157.                 % same as ¼datacolumns 0 0½
  1158. $$datafile
  1159. filename
  1160. Open a data file with the name you specify 
  1161.  
  1162. ARGUMENTS: 
  1163. filename    ± the name of the data file
  1164.  
  1165. DESCRIPTION: 
  1166. Use $b$datafile$b$ to specify the data file Asymptote should use when it reads data with 
  1167. the $b$readrow$b$ and $b$readcolumn$b$ commands.  If the data file you specify isnàt already
  1168. open in a Text Editor Window, Asymptote searches for it automatically using the 
  1169. $i$Search paths$i$ file.
  1170.  
  1171. DATA FILE FORMATS: 
  1172. Asymptote reads data from unformatted (ASCII) text files.  You can read numbers or
  1173. labels from either rows or columns of the file.  Data files are easiest to read if the
  1174. items in each line are separated by white space characters (any number of spaces
  1175. or tabs) or a single comma.  You can also skip over lines or columns in your data file
  1176. and you can read data from files that donàt have the items on  a line separated from
  1177. one another.  For a complete description of how to read data, see $i$Reading Data$i$ in
  1178. Chapter 3 or type 
  1179.    help Reading data
  1180. in the $i$Command Window$i$.
  1181.  
  1182. USING THE SEARCH PATHS FILE TO OPEN YOUR DATA FILE AUTOMATICALLY:
  1183. If you have difficulty getting Asymptote to locate a file for you automatically, make sure 
  1184. youàve properly specified a search path to the file in your Search Paths file.  Also, check
  1185. to make sure you have spelled the name of the file correctly (including spaces).  For
  1186. help specifying search paths, see $i$Search Paths$i$ or type
  1187.    help Search Paths
  1188. in the $i$Command Window$i$.
  1189.  
  1190. SPECIFYING THE FULL OR PARTIAL PATH NAME OF YOUR DATA FILE:
  1191. It is best to let Asymptote locate files for you automatically by including the path to your 
  1192. file in the Search Paths file.  Locating files this way has the advantage that if you move 
  1193. your files to a different location, you need only change your Search Paths file to have 
  1194. Asymptote locate them automatically.  It is possible, however, to specify the location of a 
  1195. file completely when you issue the $b$datafile$b$ command.  The complete description of 
  1196. a fileàs location is called the ¼full path name.½ Full path names start with a disk name 
  1197. (usually your hard disk name) followed by the name of each subfolder (separated by 
  1198. colons) and the filename.  For example, to locate the file "xyz" in the folder "March 12" 
  1199. which is on the hard disk named "My Disk" use
  1200.     datafile My disk:March 12:xyz
  1201. Itàs also possible to give a ¼partial path name½ if the file you want is in the Asymptote 
  1202. folder or in some folder within the Asymptote directory.  For example, if the folder
  1203. "March 12" were in the same folder with Asymptote, you could use the partial path name:
  1204.     datafile :March 12:xyz
  1205. Notice that partial path names begin with a colon, while full path names do not.  Partial 
  1206. path names always start their search with the same folder as Asymptote.
  1207.  
  1208. OPENING A SEQUENCE OF FILES BY NUMBER:
  1209. If you have a sequence of data files to plot, you can plot them automatically by including a 
  1210. user variable in the filename.  For example, suppose you have a series of files named, 
  1211. ¼Run 1 Raw Data½, ¼Run 2 Raw Data½, ¼Run 3 Raw Data½.  First, create a script called 
  1212. ¼plotraw½ that looks like this:
  1213.  
  1214. clear                % clear the $i$Graph Window$i$
  1215. datafile Run \i  Raw Data
  1216. readcolumn x 1
  1217. readcolumn y 2
  1218. % create the plot with more commands here...
  1219. print                % print the graph
  1220.  
  1221. Notice that the $b$datafile$b$ command in this script inserts the user variable $i$i$i$ into 
  1222. the filename.  Next, create a short script that increments $i$i$i$ while running the ¼plotraw½ 
  1223. script:
  1224.  
  1225. for i from 1 to 3 do plotraw
  1226.  
  1227. When you insert a user variable in a filename, precede the name with a \ (backslash)
  1228. and follow it with a single space.  Asymptote removes the backslash and the space and 
  1229. substitutes the variable.  Asymptote uses the settings of $b$notation$b$ and $b$digits$b$ to
  1230. convert the numerical value of the variable to text.
  1231.  
  1232. SEE ALSO:
  1233. $i$Reading data$i$
  1234. $i$Search Paths$i$
  1235. $i$Window menu$i$
  1236. $b$datalines$b$ $b$datacolumns$b$
  1237. $b$readcolumn$b$  $b$readrow$b$
  1238.  
  1239. EXAMPLES:
  1240. datafile june data            % open the file "june data"
  1241.  
  1242. datafile :march 1988:run1        % open "run1" in the folder "march 1988"
  1243.  
  1244. datafile ?                % open a file interactively via a dialog box
  1245.  
  1246. set counter 3
  1247. datafile test #\counter  data        % open the data file ¾test #3 dataà
  1248. datafile test\counter -new        % open the data file ¾test3-newà
  1249. $$datalines
  1250. [ startline [ endline ] ]
  1251. Specify what lines of the data file to use when reading data
  1252.  
  1253. ARGUMENTS: 
  1254. startline    ± staring line number to use when reading data
  1255. endline        ± last line (inclusive) to use when reading data
  1256.  
  1257. DESCRIPTION: 
  1258. Use the $b$datalines$b$ command to tell Asymptote which lines of the data file you want 
  1259. to use when reading data.  You can use $b$datalines$b$ to skip over header lines at the 
  1260. beginning of your data file or to read a particular set of lines rather than all of the
  1261. lines in a file.
  1262.  
  1263. To read every line from the data file, issue $b$datalines$b$ with no arguments.  To skip 
  1264. over lines at the beginning of your data file (a header for example), specify only the
  1265. first argument, $i$startline$i$, when you issue the $b$datalines$b$ command.  Specify both 
  1266. startline and endline if you want to read specific lines from your data file.
  1267.  
  1268. ¥ Note  If you don't want to count lines in the data file, select the lines you want to read
  1269. and type
  1270.     datalines ?
  1271. in the $i$Command Window$i$ or select $i$Lines$i$ from the $i$Data menu$i$.   
  1272. Asymptote prompts you with the $b$datalines$b$ dialog box, and enters the lines you 
  1273. selected as the default starting and ending lines.  Another way to determine the line
  1274. number of a particular line is to click that line and select Edit>Go˚To˚Line Asymptote
  1275. displays the line number you clicked as the default choice in the ¼Go To Line½ dialog box.
  1276.  
  1277. SEE ALSO:
  1278. $b$datafile$b$ $b$datacolumns$b$
  1279. $b$readcolumn$b$  $b$readrow$b$
  1280. $i$Go to Line #...$i$
  1281.  
  1282. EXAMPLES:
  1283. datalines 10 23    % use lines 10 through 23 when reading data
  1284. datalines        % use all lines in the data file
  1285.             % same as ¼datalines 0 0½
  1286.  
  1287. datalines ?        % to choose the data lines interactively
  1288. $$digits
  1289. [ n ]
  1290. Set the number of digits to display when converting numbers to labels
  1291.  
  1292. ARGUMENTS: 
  1293. n    ± number of digits to display when converting numbers to labels
  1294.         
  1295. DESCRIPTION: 
  1296. Use $b$digits$b$ to specify how many significant digits you want Asymptote to display 
  1297. when it converts numbers into labels.  To decide how to convert numbers into text, 
  1298. Asymptote uses the number of digits you specify and the $b$notation$b$ you have chosen.  
  1299. For most notation formats, $b$digits$b$ selects the number of significant digits you want 
  1300. to display in the number.  Use $b$digits$b$ = 0 to show all the digits in a number.  For the 
  1301. 'decimal' notation ($b$notation$b$ = -2), $b$digits$b$ specifies how many digits to show 
  1302. $i$after$i$ the decimal point.  With 'decimal' notation set $b$digits$b$ to a large number 
  1303. (say >10) if you want Asymptote to show all the digits in the number.
  1304.  
  1305. The following examples show how Asymptote converts the value 123.456789 to a label 
  1306. using a variety of notation formats.
  1307.  
  1308. $b$notation$b$        $b$digits$b$        Label
  1309. decimal        4        123.4568
  1310.             2        123.46
  1311.             0        123
  1312. For the ¾decimalà notation, $b$digits$b$ is the number of digits to display after the decimal 
  1313. point.  If the value is 0, the ¾decimalà notation displays ¼0.0½ unless $b$digits$b$ is 0, in 
  1314. which case a ¼0½ with no decimal point is displayed.
  1315.  
  1316. $b$notation$b$        $b$digits$b$        Label
  1317. float            4        123.5
  1318.             2        123
  1319.             0        123.456789
  1320. For the ¾floatà notation, $b$digits$b$ is the number of significant digits to display.  The 
  1321. float notation always displays ¼0½ if the value is 0.
  1322.  
  1323. $b$notation$b$        $b$digits$b$        Label
  1324. general        4        123.5
  1325.             2        123
  1326.             0        123.456789
  1327. The ¾generalà format uses ¾scientificà notation if the value is greater than 1˚x10^6, 
  1328. otherwise the ¾floatà notation is used.  The general notation always displays ¼0½ if the
  1329. value is 0.
  1330.  
  1331. The ¾defaultà notation always uses scientific notation:
  1332. $b$notation$b$        $b$digits$b$        Label
  1333. default            4        1.235˚x˚10^2
  1334.             2        1.2˚x˚10^2
  1335.             0        1.23456789˚x˚10^2
  1336. For the ¾defaultà notation, $b$digits$b$ is the number of significant digits in the mantissa.  
  1337. The default notation always displays ¼0½ if the value is 0.
  1338.  
  1339. The ¾scientificà notation uses scientific notation: 
  1340. $b$notation$b$        $b$digits$b$        Label
  1341. scientific        4        1.235˚x˚10^2
  1342.             2        1.2˚x˚10^2
  1343.             0        1.23456789˚x˚10^2
  1344. For the ¾scientificà notation, $b$digits$b$ is the number of significant digits in the mantissa.
  1345. If the value is 0 and $b$digits$b$is 0, ¾scientificà notation displays ¼0½, otherwise
  1346. ¼0.0½ is displayed.
  1347.  
  1348. The ¾hhmmssà notation displays hour, minutes and seconds:
  1349. $b$notation$b$        $b$digits$b$        Label
  1350. hhmmss        4        123h 27m 24.4s
  1351.             2        123h 27m
  1352.             0        123h 27m 24s
  1353. For the ¾hhmmssà notation, if $b$digits$b$ is 0, the time is displayed with no decimal 
  1354. point in the seconds portion.  If $b$digits$b$ is 1, only the hours are displayed.  If 
  1355. $b$digits$b$ is 2, the hours and minutes are displayed.  If $b$digits$b$ is >3, $b$digits$b$ - 3
  1356. is the number digits to display after the decimal point in the seconds portion
  1357. of the label.  If the value is 0, ¼0h½ is always displayed.
  1358.  
  1359. The ¾ddmmssà notation displays degrees, minutes and seconds:
  1360. $b$notation$b$        $b$digits$b$        Label
  1361. ddmmss        4        123¡27à 24.4àà
  1362.             2        123¡ 27à
  1363.             0        123¡ 27à 24àà
  1364. For the ¾ddmmss notation, if $b$digits$b$ is 0, the angle is displayed with no decimal 
  1365. points in the seconds portion.  If $b$digits$b$ is 1, only the degrees are displayed.  If 
  1366. $b$digits$b$ is 2, the degrees and minutes are displayed.  If $b$digits$b$ is >3, $b$digits$b$ - 3
  1367. is the number digits to display after the decimal point in the seconds portion
  1368. of the label.  If the value is 0, ¼0¡½ is always displayed.
  1369.  
  1370. SEE ALSO:
  1371. $b$notation$b$
  1372. $b$drawlabel$b$
  1373. $b$drawtitle$b$  $b$drawxlabel$b$  $b$drawylabel$b$  $b$drawlabel$b$
  1374.  
  1375. EXAMPLES:
  1376. digits ?How many digits should I show in the label?
  1377. set temp 1.23456789
  1378. moveto ?
  1379. notation general
  1380. drawlabel temp = \temp
  1381.  
  1382. digits 2
  1383. set temp y(10)    % use a variable to hold the value of the 10th y point
  1384. drawlabel belowleft Y value of point #10 = \temp
  1385. $$drawarrowto
  1386. x y
  1387. Draw an arrow from the current pen position to (x, y)
  1388.  
  1389. ARGUMENTS: 
  1390. x    ± x position at the end of the arrow
  1391. y    ± y position at the end of the arrow
  1392.  
  1393. DESCRIPTION: 
  1394. Use $b$drawarrowto$b$ to draw a line from the current pen location to the coordinates you 
  1395. specify.  Asymptote caps the line with an arrowhead.  Asymptote uses the current pen 
  1396. properties when you draw arrows.  Use any of the commands like $b$pensize$b$ and 
  1397. $b$pendash$b$ to change the appearance of the line (see $i$graphics˚environment$i$).  
  1398. You can change the size of the arrowhead with the $b$scale$b$ command.  
  1399.  
  1400. A convenient way to add a arrow to your graph is to use  a question mark following the 
  1401. $b$drawarrowto$b$ command.  Type
  1402.     drawarrowto ?
  1403. in the $i$Command Window$i$ or in a script.  Asymptote activates the graph cursor.  When you 
  1404. click, Asymptote draws an arrow that points to the location you clicked.
  1405.  
  1406. Remember, to draw arrows that extend outside the graph frame, set $b$cliptoframe$b$ to 
  1407. false before you use $b$drawarrow$b$. otherwise, Asymptote truncates your line if it 
  1408. extends outside the frame.
  1409.  
  1410. SEE ALSO:
  1411. $i$graphics environment$i$
  1412. $b$moveto$b$ $b$drawto$b$ $b$cursor$b$
  1413. $b$pensize$b$ $b$pendash$b$ $b$penpattern$b$ $b$pencolor$b$
  1414. $b$scale$b$
  1415. $b$cliptoframe$b$ 
  1416.  
  1417. EXAMPLES:
  1418. drawarrowto 3.4 56.9    % draw arrow from current (x, y) to (3.4 56.9)
  1419. drawarrowto ?        % choose x, y using the cursor
  1420.  
  1421. pencolor red
  1422. pendash short
  1423. drawarrow 4 y 10 +        % draw a red, dashed arrow to (4,y+10)
  1424.  
  1425. drawarrowto x(5) y(5)    % draw a arrow to the 5th data point.
  1426.  
  1427. $$drawaxis
  1428. axis[tickpos[labelpos[drawline[drawticks[drawlabels]]]]]
  1429. Draw an axis on one side of the graph frame
  1430.                     
  1431. ARGUMENTS: 
  1432. axis  ± selects which axis to draw
  1433.             bottom            (=1)
  1434.             left            (=2)
  1435.             top            (=3)
  1436.             right            (=4)
  1437. tickpos      ± selects whether to draw the tick marks inside or outside the graph frame
  1438.             inside            (=1)
  1439.             outside            (=2)
  1440. labelpos  ± selects whether to draw the tick mark labels inside or outside the  frame
  1441.             inside            (=1)
  1442.             outside            (=2)
  1443. drawline  ± selects whether to draw the axis line or not
  1444.             noline            (=0)
  1445.             line            (=1)
  1446. drawticks  ± selects whether ticks should point inside or outside the graph 
  1447.             noticks            (=0)
  1448.             inside            (=1)
  1449.             outside            (=2)
  1450. drawlabels  ± selects whether to draw tick labels parallel or perpendicular to the axis
  1451.             nolabels        (=0)
  1452.             parallel        (=1)
  1453.             perpendicular      (=2)
  1454.  
  1455. DESCRIPTION: 
  1456. Use $b$drawaxis$b$ to draw individual axes on your graph.  Although the $b$drawframe$b$
  1457. command is a convenient way to draw axes on your graph, there are times youàll
  1458. need to have more control drawing axes.  That's when the $b$drawaxis$b$ command
  1459. is useful. 
  1460.  
  1461. The first argument to $b$drawaxis$b$ specifies which axis to draw.  Specify either the top, 
  1462. bottom, left or right axis of the frame.  You must supply the first argument to 
  1463. $b$drawaxis$b$, all the other arguments are optional. The second argument lest you 
  1464. specify whether or not you want Asymptote to draw the axis line.  This is useful if you
  1465. are drawing an axis line in a different style or color that is different from the tick marks.  
  1466. Finally, the third and fourth arguments to $b$drawaxis$b$specify how tick marks and
  1467. tick mark labels, if any, are drawn.
  1468.  
  1469. Asymptote uses the variables of the $i$graphics environment$i$ to draw the axis.  Before 
  1470. you issue the $b$drawaxis$b$ command, make sure you set the following variables:
  1471.  
  1472. TO:                            USE:
  1473. Set starting or ending values of the axis        $b$graphlimits$b$ 
  1474. Set the major and minor tick mark spacing        $b$graphticks$b$ 
  1475. Set the position the graph frame            $b$graphframe$b$
  1476. Set the line size or color of the axis            $b$pensize$b$,
  1477.                             $b$pencolor$b$, etc.
  1478. Set the size of tick marks and tick labels        $b$scale$b$
  1479. Set the default size for tick marks            $b$ticksize$b$
  1480. Set the default size for tick labels            $b$fontsize$b$
  1481. Set the notation for tick labels            $b$notation$b$
  1482. Set the font for tick labels                $b$fontname$b$
  1483.  
  1484. Remember you can issue the $b$drawaxis$b$ command more than once to draw an axis.  
  1485. For example, you might call $b$drawaxis$b$ to draw thin tick marks then call 
  1486. $b$drawaxis$b$ again to draw a thicker axis line.  You could accomplish this with the 
  1487. following commands:
  1488.  
  1489. pensize 0.25                % set up for very thin tick marks
  1490. % draw just the ticks and labels:
  1491. drawaxis bottom inside outside noline inside parallel
  1492. pensize 2                % set up for a thick axis line
  1493. % draw just the axis line:
  1494. drawaxis bottom inside outside line noticks nolabel
  1495.  
  1496. To draw tick marks in a different color than the axis line, change the pen color between
  1497. the two calls to drawaxis with $b$pencolor$b$.
  1498.  
  1499. SEE ALSO:
  1500. $i$graphics environment$i$
  1501. $b$graphticks$b$
  1502. $b$graphframe$b$
  1503. $b$graphlimits$b$
  1504. $b$notation$b$ $b$scale$b$ $b$fontname$b$
  1505. $b$ticksize$b$ $b$ticksize$b$
  1506. $b$pensize$b$ $b$pendash$b$ $b$pencolor$b$ 
  1507.  
  1508. EXAMPLES:
  1509. % Draw a basic frame:
  1510. pensize .25                % Draw thick lines
  1511. fontname Times            % Choose the Times font for tick labels
  1512. graphlimits 1.2 34 0 0        % x axis goes from 1.2 to 34 but
  1513.                     %    choose y limits based on max, min of
  1514.                     %    the current y data
  1515.  
  1516. graphticks                % Let Asymptote choose tick spacing
  1517. % Draw the axis on the bottom of the graph frame:
  1518. drawaxis bottom inside outside line inside parallel  
  1519.  
  1520. % Draw a frame with thin tick marks and a thick border labels and tickmarks
  1521. % outside the frame
  1522. pensize 2                % Start out with thick lines
  1523. % Draw a fat line along left side:
  1524. drawaxis left outside outside drawline noticks nolabels    
  1525. pensize .25                % then change to thin lines and
  1526. % Draw thin tick marks inside:
  1527. drawaxis left outside outside noline inside drawlabels    
  1528.  
  1529. % Plot two sets of y data using different axes on the left and right sides of the graph:
  1530. readcol x 1            % read x
  1531. readcol y 2            % read the first set of y data
  1532. graphlimits            % auto limits
  1533. % Draw all but the right axis using the defaults for drawframe:
  1534. drawaxis bottom inside outside line inside perpendicular
  1535. drawaxis top inside outside line inside nolabels
  1536. drawaxis left inside outside line inside perpendicular
  1537. pendash            % solid line
  1538. plotline            % plot the first set of y data
  1539. readcol y 3            % read the second set of y data
  1540. graphlimits            % find the max and min for these data
  1541. % Draw the specially formatted right axis:
  1542. drawaxis right inside outside line inside perpendicular
  1543. pendash dot            % set up for a dotted lines
  1544. plotline            % plot the second set of y data as a dotted line
  1545.  
  1546. drawaxis ?            % choose how to draw an axis graphically
  1547.  
  1548. $$drawframe
  1549. [ ticks [ labels [ draw [ bottom [ left [ right [ top ]]]]]]]
  1550. Draw a frame around the graph with or without tick marks and tick mark labels
  1551.  
  1552. ARGUMENTS: 
  1553. ticks    ± selects whether ticks should be drawn inside or outside the frame 
  1554.         inside        (=1)
  1555.         outside          (=2)
  1556. labels    ± selects whether tick mark labels should be drawn inside or outside the frame 
  1557.         inside        (=1)
  1558.         outside        (=2)
  1559. draw    ± turns tick mark drawing on and off
  1560.         noticks        (=0)
  1561.         ticks        (=1)
  1562. bottom    ± selects whether to draw tick labels parallel or perpendicular to the frame
  1563. left        nolabels    (=0)
  1564. top        parallel    (=1)
  1565. right        perpendicular    (=2)
  1566.  
  1567. DESCRIPTION: 
  1568. Use $b$drawframe$b$ to quickly draw a frame around your graph and label the $i$x$i$ and $i$y$i$
  1569. axes with tick marks.  If you need greater control over how the axes should look,
  1570. or if you want to draw only one axis at a time, use the $b$drawaxis$b$ command instead.
  1571.  
  1572. Before you use $b$drawframe$b$, make sure you set the variables of the graphics 
  1573. environment.
  1574.  
  1575. TO:                            USE:
  1576. Set starting or ending values of the axis        $b$graphlimits$b$ 
  1577. Set the major and minor tick mark spacing        $b$graphticks$b$ 
  1578. Set the position of the graph frame            $b$graphframe$b$
  1579. Set the line size or color of the axis            $b$pensize$b$,
  1580.                             $b$pencolor$b$, etc.
  1581. Set the size of tick marks and tick labels        $b$scale$b$
  1582. Set the default size for tick marks            $b$ticksize$b$
  1583. Set the default size for tick labels            $b$fontsize$b$
  1584. Set the notation for tick labels            $b$notation$b$
  1585. Set the font for tick labels                $b$fontname$b$
  1586.  
  1587. To draw complicated frames, you can issue use $b$drawframe$b$  more than once.  For 
  1588. example, to draw a graph with a thick frame, thin tick marks and tick mark labels in the 
  1589. Helvetica font on all but the top of the frame you could use the following commands:
  1590. graphlim 1 23 -1 10        % x runs from 1 to 23, y from -1 to 10
  1591. pensize 3            % thick lines for the frame
  1592. drawframe inside outside noticks nolabels nolabels nolabels nolabels
  1593. pensize .25            % set up to draw thin tick lines
  1594. fontname Helvetica
  1595. drawframe inside outside ticks parallel perpendicular nolabels perpendicular
  1596.  
  1597. SEE ALSO:
  1598. $i$graphics environment$i$
  1599. $b$drawaxis$b$
  1600. $b$graphticks$b$
  1601. $b$graphframe$b$
  1602. $b$graphlimits$b$
  1603. $b$notation$b$ $b$scale$b$ $b$fontname$b$
  1604. $b$fontsize$b$ $b$ticksize$b$
  1605. $b$pensize$b$ $b$pendash$b$ $b$pencolor$b$ 
  1606.  
  1607. EXAMPLES:
  1608. drawframe ?        % Choose settings interactively
  1609.  
  1610. drawframe        % Draw a basic frame automatically
  1611.  
  1612. % This is the same as the above:
  1613. drawframe inside outside parallel perpendicular nolabels nolabels
  1614.  
  1615. % Draw ticks and tick mark labels outside the frame with labels
  1616. % going all the way around the frame:
  1617. drawframe outside outside parallel parallel parallel parallel 
  1618.  
  1619. $$drawgrid
  1620. [ drawminor ]
  1621. Draw a grid of lines at the major and optionally the minor tick marks
  1622.  
  1623. ARGUMENTS: 
  1624. drawminor    ± controls which grid lines to draw
  1625.             false => draw lines only at the major tick marks
  1626.             true => draw lines at the minor tick marks as well
  1627.  
  1628. DESCRIPTION: 
  1629. Use $b$drawgrid$b$ with no arguments to draw a dotted line grid at each major tick mark.
  1630.  
  1631. To draw grid lines at the minor tick marks, supply the single argument, drawminor, to 
  1632. $b$drawgrid$b$.  Use drawminor =˚false to draw lines at only the major tick marks, and 
  1633. drawminor = true to draw lines at both the major and minor tick marks.  When you
  1634. supply the argument to $b$drawgrid$b$ you also have greater control over how to draw the
  1635. grid lines.  For example, you can change the dash pattern for the grid lines with
  1636. $b$pendash$b$ and use $b$drawgrid$b$ to draw the grid lines.
  1637.  
  1638. SEE ALSO
  1639. $i$graphics environment$i$
  1640. $b$graphticks$b$
  1641. $b$pendash$b$
  1642.  
  1643. EXAMPLES:
  1644. pendash dot
  1645. drawgrid true        % draw dotted grid lines on major and minor ticks
  1646. pendash solid
  1647. drawgrid false        % draw solid lines at the major tick marks
  1648.  
  1649. pendash ?Choose a dash pattern for the grid:
  1650. drawgrid true
  1651. $$drawlabel
  1652. position text
  1653. Draw a label on the graph
  1654.  
  1655. ARGUMENTS: 
  1656. position    ± specifies the label position relative to the pen:
  1657.             aboveleft  (=7)    above  (=8)    aboveright  (=9)
  1658.             centerleft (=4)    center (=5)    centerright (=6)
  1659.             belowleft  (=1)    below  (=2)    belowright  (=3)
  1660.             ¥ Note: This arrangement is the same as the keys         
  1661.                 on key boards equipped with key pads.
  1662. text        ± the text of the label
  1663.  
  1664. DESCRIPTION: 
  1665. Use $b$drawlabel$b$ to add labels to your graphs.  The first argument to $b$drawlabel$b$ 
  1666. specifies how Asymptote should position the label relative to the current pen position.
  1667. For convenience you can also use Asymptoteàs built-in constants to specify the position
  1668. or specify the number (1 through 9) directly.
  1669.  
  1670. Remember, you can use $b$fontname$b$, $b$pencolor$b$, $b$scale$b$ and $b$rotation$b$ to alter the
  1671. appearance of a label and you can use $b$fontsize$b$ to change the default size for labels.
  1672.  
  1673. You can also include special $i$control characters$i$ in the text of your label to:
  1674.     ± change font within a label
  1675.     ± turn italics on or off
  1676.     ± draw super and subscripted characters
  1677.     ± insert the value of a user variable
  1678.     ± insert the current date or time
  1679.     ± insert the name of the current data file or the name of the $i$Recorder Window$i$
  1680.  
  1681. The easiest way to see how these control characters work is to select Plot>Draw Label, or 
  1682. type:
  1683.     drawlabel ?
  1684. in the $i$Command Window$i$.  Asymptote displays a dialog box in which you can construct 
  1685. your label interactively.  As you type, Asymptote shows you what the label looks like.  
  1686. You can make selections in the dialog box to insert control characters that change the 
  1687. appearance of the text.
  1688.  
  1689. The control characters in a label must be preceded by either one or two backslash, \, 
  1690. characters.  Use a single \  to format only the next character in the label.  Use ¼\\½ to
  1691. change the format for all subsequent characters.
  1692.  
  1693.     CONTROL CHARACTERS:
  1694.     \\x - set mode x for all subsequent characters
  1695.     \x  - set mode x for the next char only
  1696.  
  1697.     \t -  Change the font to Times
  1698.     \h - Change the font to Helvetica
  1699.     \s - Change to the Symbol font
  1700.     \c - Change to the Courier font
  1701.     \u - shift up for superscript
  1702.     \d - shift down for subscript
  1703.  
  1704.     \f - insert the name of the current data file
  1705.     \r - insert the name of the $i$Recorder Window$i$
  1706.     \@ - insert the current time
  1707.     \# - insert the current date
  1708.  
  1709. To insert the name of a variable or a constant in a label, type a backslash (\) followed by
  1710. the name of the variable and a single space.  Asymptote needs the space following the
  1711. variable name so it can determine where the variable name ends and the rest of the label
  1712. begins.  Asymptote removes the backslash, the space and replaces the name of the
  1713. variable with the value of the variable converted to text.  You can specify the format
  1714. for the conversion with $b$notation$b$ and $b$digits$b$.
  1715.  
  1716. Remember that to draw a label outside the graph frame, you need to set $b$cliptoframe$b$ 
  1717. to false before you use $b$drawlabel$b$.
  1718.  
  1719. SEE ALSO:
  1720. $i$graphics environment$i$
  1721. $i$User Variables$i$
  1722. $i$Asymptote Variables$i$
  1723. $b$fontname$b$ $b$scale$b$ $b$rotation$b$ 
  1724. $b$pencolor$b$ $b$textmode$b$
  1725. $b$moveto$b$ $b$drawto$b$ 
  1726. $b$notation$b$ $b$digits$b$ 
  1727. $b$cliptoframe$b$ 
  1728. $b$fontsize$b$ 
  1729.  
  1730. EXAMPLES:
  1731. moveto 10 12                % position the pen at (10,12)
  1732. drawlabel center Frequency (Hz)    % draws the label  "Frequency (Hz)"
  1733.                     % centered on the current pen position.
  1734.  
  1735. moveto ?Click where would you like to place the label:
  1736. drawlabel ?                % Get the text of the label interactively
  1737.                     % using the Draw Label dialog box
  1738.  
  1739. % Draw the label y = e(x2 + y2) + sin(t) to the right of the pen:
  1740. drawlabel centerright y = e\\u(x\u2 + y\u2)\\d + sin(\st)
  1741.  
  1742. % Put a label with the date and the name of the current data file in the upper
  1743. % left hand corner of the graph:
  1744. moveto \xright \xleft - .1 * \xleft + \ytop \ybottom - .9 * \ybottom +
  1745. drawlabel 6 Data from: \f   Date: \#
  1746.  
  1747. % Set a user variable and use it in a label
  1748. set runnumber 3
  1749. % draw the label ¼Run #3 data½ to the right of the pen
  1750. drawlabel centerright Run #\runnumber data
  1751. $$drawpoint
  1752.  
  1753. Draw a point at the pen position 
  1754.  
  1755. ARGUMENTS: 
  1756. none
  1757.  
  1758. DESCRIPTION: 
  1759. Use $b$drawpoint$b$ to draw a point on your graph.  Asymptote draws the point at the 
  1760. current pen position.  You can specify the symbol to draw with $b$pointsymbol$b$.  You 
  1761. will probably find $b$drawpoint$b$ most useful when you are adding legends to your 
  1762. graph or when you want to draw a single point on your graph.
  1763.  
  1764. The size and rotation of the point are controlled by the $b$scale$b$ and $b$rotation$b$ 
  1765. commands.  Set the default label size with the $b$fontsize$b$ 
  1766. command.  The current pen characteristics and fill pattern are also used to draw the
  1767. point (see $i$graphics environment$i$).
  1768.  
  1769. Remember that to draw a point outside the graph frame, you need to set $b$cliptoframe$b$ 
  1770. to false before you use $b$drawpoint$b$.
  1771.  
  1772. SEE ALSO:
  1773. $i$graphics environment$i$
  1774. $b$pencolor$b$ $b$pensize$b$ $b$penpattern$b$ $b$penmode$b$
  1775. $b$fillpattern$b$  $b$scale$b$  $b$rotation$b$
  1776. $b$moveto$b$ $b$drawto$b$
  1777. $b$cliptoframe$b$ 
  1778. $b$fontsize$b$ 
  1779.  
  1780. EXAMPLES:
  1781. moveto x .1 + y        % shift the position of the pen by .1 units in x
  1782. pointsymbol 4 filled        % choose to draw a filled square
  1783. drawpoint            % draw a filled square at the shifted position
  1784.  
  1785. moveto ?                    % Position the pen interactively
  1786. pointsymbol ?What point symbol?        % Choose a point symbol graphically
  1787. drawpoint
  1788. $$drawtitle
  1789. text
  1790. Add a title to the graph centered above the graph frame
  1791.  
  1792. ARGUMENTS: 
  1793. text    ± the text of the title
  1794.  
  1795. DESCRIPTION: 
  1796. Use $b$drawtitle$b$ to draw a title on your graph.  Asymptote centers the title above the 
  1797. graph frame.  You can change the position of the frame on the page with 
  1798. $b$graphframe$b$.  To put the title somewhere else on the page, use $b$moveto$b$ and 
  1799. $b$drawlabel$b$ instead.
  1800.  
  1801. As with any label, you can change any of the variables of the 
  1802. $i$graphics˚environment$i$.such as $b$fontname$b$, $b$pencolor$b$, and 
  1803. $b$scale$b$to change the appearance of the title and you can change the default label size 
  1804. with $b$fontsize$b$.  The title text can also include control characters to format individual 
  1805. characters or words or to insert the date, the name of the data file or the value of a
  1806. variable.  See the description of the $b$drawlabel$b$ command for an explanation how to
  1807. use control characters in labels.
  1808.  
  1809. Remember, you can interactively edit and view how your title looks by typing the 
  1810. command
  1811.     drawtitle ?
  1812. in the $i$Command Window$i$, or by selecting Draw>Title.
  1813.  
  1814. SEE ALSO:
  1815. $i$graphics environment$i$
  1816. $b$drawlabel$b$
  1817. $b$fontname$b$ $b$scale$b$ $b$pencolor$b$ $b$textmode$b$
  1818. $b$fontsize$b$
  1819. $b$moveto$b$ $b$drawto$b$
  1820.  
  1821. EXAMPLES:
  1822. drawtitle The effect of gamma rays on man-in-the-moon marigolds
  1823.  
  1824. fontname Helvetica
  1825. scale 2.0
  1826. drawtitle H\sa Line Intensities from data file:\f
  1827. $$drawto
  1828. x y
  1829. Draw a line from the current pen position to ($i$x$i$, $i$y$i$)
  1830.  
  1831. ARGUMENTS: 
  1832. x, y    ± $i$x$i$ and $i$y$i$ coordinates of the end of the line
  1833.  
  1834. DESCRIPTION: 
  1835. Use $b$drawto$b$ to draw a line from the current pen location to the coordinates you 
  1836. specify.  Asymptote uses the current pen properties to draw the line.  Use any of the 
  1837. commands like $b$pensize$b$ and $b$pendash$b$ to change the appearance of the line 
  1838. (see $i$graphics environment$i$).
  1839.  
  1840. A convenient way to draw a line on your graph is to use ? following the $b$drawto$b$ 
  1841. command.  Type
  1842.     drawto ?
  1843. in the $i$Command Window$i$ or in a script.  Asymptote activates the graph cursor which you 
  1844. can use to position the end of the line with the mouse.  You can also select Draw>Move˚To 
  1845. to activate the graph cursor.
  1846.  
  1847. Remember that to draw a line outside the graph frame, you need to set $b$cliptoframe$b$ 
  1848. to false before you use $b$drawto$b$.
  1849.  
  1850. SEE ALSO:
  1851. $i$graphics environment$i$
  1852. $b$moveto$b$ $b$drawarrowto$b$ $b$cursor$b$
  1853. $b$pensize$b$ $b$pendash$b$ $b$penpattern$b$ $b$pencolor$b$
  1854. $b$scale$b$
  1855. $b$cliptoframe$b$
  1856.  
  1857. EXAMPLES:
  1858. drawto 3.4 56.9    % draw a line from the current pen position to (3.4 56.9)
  1859. drawto ?        % set the end point of the line with the graph cursor
  1860.  
  1861. pencolor red
  1862. pendash short
  1863. drawto 4 y 10 +    % draw a red, dashed line from (x,y) to (4,y+10)
  1864.  
  1865. pensize 4            % get ready to draw a fat line
  1866. moveto 1 1            % move to (1,1)
  1867. drawto x(10) y(10)        % draw a line from (1,1) to the position
  1868.                 % of the 10th data point
  1869. $$drawxlabel
  1870. text
  1871. Add a label to the x axis of the graph
  1872.  
  1873. ARGUMENTS: 
  1874. text    ± the text of the label
  1875.  
  1876. DESCRIPTION: 
  1877. Use $b$drawxlabel$b$ to label the $i$x$i$ axis of your graph.  Asymptote draws $i$x$i$ labels centered
  1878. below the graph frame.  You can change the position of the frame on the page with
  1879. the $b$graphframe$b$ command.  If you want to put the $i$x$i$ label elsewhere on the page,
  1880. use $b$moveto$b$ and $b$drawlabel$b$ instead.
  1881.  
  1882. As with any label, you can change the appearance of the text by adjusting the variables of 
  1883. the $i$graphics environment$i$.  You can include control characters in the label to format 
  1884. the text or to insert the value of a variable or constant.  See the description of the 
  1885. $b$drawlabel$b$ command for an explanation.
  1886.  
  1887. If you want to choose text of the label interactively, put the command
  1888.     drawxlabel ?
  1889. into your script or select Draw>X˚Label.
  1890.  
  1891. SEE ALSO:
  1892. $i$graphics environment$i$
  1893. $b$drawlabel$b$ $b$drawylabel$b$ $b$drawtitle$b$
  1894. $b$fontname$b$ $b$scale$b$ $b$pencolor$b$ $b$textmode$b$
  1895. $b$fontsize$b$
  1896. $b$scale$b$
  1897. $b$moveto$b$ $b$drawto$b$
  1898.  
  1899. EXAMPLES:
  1900. drawxlabel Frequency (Hz)
  1901.  
  1902. pencolor gray
  1903. drawxlabel Sin(\\st + o\\t)
  1904. $$drawylabel
  1905. text
  1906. Add a label to the y axis of the graph
  1907.  
  1908. ARGUMENTS: 
  1909. text    ± the text of the label
  1910.  
  1911. DESCRIPTION: 
  1912. Use $b$drawylabel$b$ to label the $i$y$i$ axis of your graph.  Asymptote draws $i$y$i$ labels centered
  1913. below the graph frame.  You can change the position of the frame on the page with the
  1914. $b$graphframe$b$ command.  If you want to put the $i$y$i$ label elsewhere on the page, 
  1915. use $b$moveto$b$ and $b$drawlabel$b$ instead.
  1916.  
  1917. As with any label, you can change the appearance of the text by adjusting the variables of 
  1918. the $i$graphics environment$i$.  You can include control characters in the label to format 
  1919. the text or to insert the value of a variable or constant.  See the description of the 
  1920. $b$drawlabel$b$ command for an explanation.
  1921.  
  1922. If you want to choose text of the label interactively, put the command
  1923.     drawylabel ?
  1924. into your script or select Draw>Y˚Label.
  1925.  
  1926. SEE ALSO:
  1927. $i$graphics environment$i$
  1928. $b$drawlabel$b$ $b$drawxlabel$b$ $b$drawtitle$b$
  1929. $b$fontname$b$ $b$scale$b$ $b$pencolor$b$ $b$textmode$b$
  1930. $b$fontsize$b$ $b$scale$b$
  1931. $b$moveto$b$ $b$drawto$b$
  1932.  
  1933. EXAMPLES:
  1934. drawylabel Temperature (K)
  1935.  
  1936. pencolor gray
  1937. drawylabel Sin(\\st + o\\t)
  1938. $$export
  1939. [x][y][e][p][l]
  1940. Write the values of Asymptoteàs vectors in the Data Window
  1941.  
  1942. ARGUMENTS: 
  1943. x,y,e,p,l    ± the names of the vectors to export (can be in any order)
  1944.  
  1945. DESCRIPTION: 
  1946. You can use the export command to write out the values of Asymptote's vectors in the 
  1947. $i$Data Window$i$.  First, use the datafile command to open a data file.  Next, issue the 
  1948. $b$export$b$ command.  You can follow the $b$export$b$ command with the name or names of the 
  1949. vectors you want to export.  For example, to export the $i$x$i$ $i$y$i$ and $i$e$i$ vectors to the 
  1950. $i$Data Window$i$, use
  1951.     export x y e
  1952. You can export vectors in any order.  If you don't specify which vectors you want to 
  1953. export, Asymptote exports the $i$x$i$ and $i$y$i$ vectors.
  1954.  
  1955. Asymptote uses the current value of the Asymptote variable $i$digits$i$ (set with the $b$digits$b$
  1956. command) to determine how many digits will follow the decimal point in floating point 
  1957. numbers.  Large or very small numbers appear in exponential notation.
  1958.  
  1959. You might also use export to save the results of some lengthy calculation in Asymptote.  
  1960. Remember, you can use the registers of the rpn calculator to store whole vectors.  The 
  1961. $b$export$b$ command might also be useful when you use $b$readcursor$b$ to read data from 
  1962. your graph and export the data to another application.
  1963.  
  1964. SEE ALSO:
  1965. $b$datafile$b$
  1966. $b$digits$b$
  1967. $b$readcursor$b$
  1968.  
  1969. EXAMPLES:
  1970. digits 3         % Use 3 digits following the decimal point
  1971. export            % Export the x and y vectors only
  1972.  
  1973. export y e p        % Export y e and p in that order
  1974.  
  1975. export x y e p l    % Export everything
  1976. $$fillpattern
  1977. pattern
  1978. Set the fill pattern for points and polygons
  1979.  
  1980. ARGUMENTS: 
  1981. pattern    ± the number of the new pattern:
  1982.             0 through 38
  1983.              or the pattern name
  1984.             none, black, darkgray, gray, lightgray,
  1985.             squares, vertical, horizontal, diagonal,
  1986.             white, bricks
  1987.  
  1988. DESCRIPTION:
  1989. Use $b$fillpattern$b$ to set the fill pattern for drawing points and polygons.  Valid pattern 
  1990. numbers are 0 through 38 or the names: none, black, darkgray, gray, lightgray,
  1991. squares, vertical, horizontal, diagonal, white, bricks.  These pattern numbers are
  1992. Asymptote constants (see $i$Variables and Constants$i$).
  1993.  
  1994. Remember, you can select Set>Fill˚Pattern or type
  1995.     fillpattern ?
  1996. in the $i$Command Window$i$ to choose the fill pattern from a picture of the various fill 
  1997. patterns. 
  1998.  
  1999. SEE ALSO: 
  2000. $i$Variables and Constants$i$
  2001. $b$penpattern$b$
  2002. $b$pencolor$b$
  2003. $b$plotpoints$b$ $b$plotpolygon$b$ $b$plothistogram$b$ 
  2004.  
  2005. EXAMPLES:
  2006. fillpattern gray        % draw solid gray filled squares at each point
  2007. pointsymbol 4 filled
  2008. plotpoints
  2009.  
  2010. fillpattern penpattern    % make the fill pattern the same as the pen pattern
  2011.  
  2012. rpn ran >x ran >y
  2013. graphlimits
  2014. fillpattern ?Pick a fill pattern for this polygon:
  2015. plotpoly
  2016. $$fitxy
  2017. [[ N ] expression ]
  2018. Fit y = f(x) with a polynomial or a function you specify
  2019.  
  2020. N        ± the order of the polynomial to fit (default = 1)
  2021.            1 = linear, 2 = quadratic, 3 = cubic, etc,..
  2022. OR
  2023. N        ± the number of parameters in the function to fit
  2024. expression    ± an expression for the function to fit
  2025.  
  2026. DESCRIPTION: 
  2027. Use $b$fitxy$b$ to fit a function to the ($i$x$i$, $i$y$i$) data points using least squares.  The function 
  2028. can either be a polynomial or a general expression that you specify.
  2029.  
  2030. ____________________ TO FIT A POLYNOMIAL ___________________________________
  2031. To fit a polynomial 
  2032.     y = a0 + a1 x + a2 x^2 + ... + aN x^N
  2033. to your ($i$x$i$, $i$y$i$) data, follow the $b$fitxy$b$ command with a single  argument, N (the order of 
  2034. the polynomial to fit).  For example, the command
  2035.     fitxy 3
  2036. fits the function 
  2037.     y = a0 + a1 x + a2 x^2 + a3 x^3.
  2038. You can use the values in the e vector to give a different weight to each of the ($i$x$i$, $i$y$i$) 
  2039. points in the polynomial fit.  See Using Errors below.
  2040.  
  2041. After the fit, Asymptote updates the values of the $i$a0$i$, $i$a1$i$, $i$a2$i$, ... , $i$aN$i$ user variables with 
  2042. the polynomial coefficients.  It also stores the error for each coefficient (the diagonal 
  2043. elements of the covariance matrix) in the user variables $i$a0sig$i$, $i$a1sig$i$, ... , $i$aNsig$i$.  
  2044. Asymptote stores the chi square of the fit in the user variable chisq.  You can use rpn 
  2045. and plotline to calculate the fit and plot it on top of your data.  For example, to fit 
  2046. a 2nd order polynomial and plot the final fit use the following commands:
  2047.     fitxy 2
  2048.     rpn <x 2 y^x a2 * <x a1 * + a0 + >y
  2049.     plotline
  2050. When you select Data>Fit˚Y˚=˚F(x), Asymptote displays a dialog box which makes it easy 
  2051. to fit your data and plot the final fit.
  2052.  
  2053. ____________________ TO FIT A FUNCTION ___________________________________
  2054. To fit an arbitrary function to your data, follow the $b$fitxy$b$ command with two arguments.  
  2055. The first argument is the number of parameters in the function you want to fit.  The 
  2056. second argument is an rpn expression for the function.  The expression should evaluate 
  2057. to a single argument.  For example, to fit a sine wave with phase $i$a0$i$ and amplitude $i$a1$i$, 
  2058. you could use
  2059.     fitxy 2 x a0 - sin a1 *
  2060. The expression "x a0 - sin a1 *" subtracts $i$a0$i$ from each x data point, calculates the 
  2061. sine and multiplies the result by $i$a1$i$.
  2062.  
  2063. The easiest way to write $b$fitxy$b$ expressions is to select Data Fit Y = F(x) and use the 
  2064. fitxy dialog box to specify what you want to fit.  Asymptote's curve fit dialog helps 
  2065. guide you through the process of fitting your data. 
  2066.  
  2067. INITIAL VALUES FOR PARAMETERS:
  2068. Asymptote uses the Levenburg-Marquardt method to estimate the values of up to 32 free 
  2069. parameters by minimizing chi square.  Asymptote must begin this process starting with 
  2070. your best guesses for the values of the model parameters.  If you don't supply good 
  2071. initial values for the parameters, $b$fitxy$b$ will probably produce poor results.  You can 
  2072. create and set the initial values of the fitting variables $i$a0$i$, $i$a1$i$, ... , $i$aN$i$ using the set 
  2073. command.  If a variable doesn't exist when $b$fitxy$b$ starts, Asymptote creates a new user 
  2074. variable and sets its initial value to 1.0.
  2075.  
  2076. HOLDING PARAMETERS FIXED:
  2077. Asymptote looks for the user variables $i$a0fixed$i$, $i$a1fixed$i$, ... , $i$aNfixed$i$ to determine if 
  2078. you want to hold any of the fitting parameters fixed.  If you set one of these variables 
  2079. to 'true' (a non-zero value), Asymptote holds that parameter fixed during the fit.
  2080.  
  2081. USING ERRORS (WEIGHTING EACH DATA POINT):
  2082. Both polynomial fitting and general expression fitting use the values in the $i$e$i$ vector to 
  2083. constrain the fit.  If you know the standard deviation of each point, store these values 
  2084. in the $i$e$i$ vector before fitting.  With the $i$e$i$ vector you can weight each of the points 
  2085. differently in the fit.  A smaller value in the $i$e$i$ vector means a greater weight is given 
  2086. to that point and a greater impact on the fit.  To remove a point from the fit entirely, 
  2087. set its $i$e$i$ vector to a value much larger then the other values in the $i$e$i$ vector.  If the 
  2088. $i$e$i$ vector contains zero or negative values, Asymptote asks you if you want to give all 
  2089. the points equal weight.
  2090.  
  2091. If you don't know the errors of your data points, use
  2092.     rpn 1 >e
  2093. to fill the $i$e$i$ vector with a constant value of 1.0 for each point.  When the $i$e$i$ vector
  2094. is 1.0 for all points, Asymptote automatically multiplies the fit errors $i$a0sig$i$, $i$a1sig$i$, ..., 
  2095. $i$aNsig$i$, by sqrt[chisq/(npts - nParameters)].  Essentially this assumes that the fit is a
  2096. good fit.  Remember that if you don't know the errors in your data points, the value of chisq
  2097. is meaningless.
  2098.  
  2099. PLOTTING EACH ITERATION:
  2100. To help you view the progress of the fit, set the user variable $i$plot_each_fit$i$ to true 
  2101. before you execute $b$fitxy$b$.  With $i$plot_each_fit$i$ set to true, Asymptote plots the fitted 
  2102. function on your graph with each iteration.  When $b$fitxy$b$ finishes, Asymptote restores 
  2103. the graph to the way it looked before $b$fitxy$b$ started.  Plotting each iteration is a good 
  2104. way to monitor the progress of the fit and to judge how good your initial guesses were.  
  2105. If the user variable $i$plot_each_fit$i$ doesn't exist before $b$fitxy$b$ starts, Asymptote creates 
  2106. the variable and sets it to true.
  2107.  
  2108. FIT RESULTS:
  2109. After $b$fitxy$b$ executes, Asymptote sets the user variable chisq to the final chi square of 
  2110. the fit.  It sets the user variables $i$a0$i$, $i$a1$i$, $i$a2$i$, ..., $i$aN$i$ to the estimated parameter values.  
  2111. Asymptote stores an estimate of the error of each parameter (diagonal elements of the 
  2112. covariance matrix) in the user variables $i$a0sig$i$, $i$a1sig$i$, ... , $i$aNsig$i$.  It also sets the 
  2113. variable converged to true or false depending on whether $b$fitxy$b$ converged to a best fit 
  2114. and sets the variable iterations to the number of iterations that were completed.
  2115.  
  2116. IF YOUR FIT PRODUCES UNDESIRABLE RESULTS:
  2117. If you aren't able to obtain a satisfactory fit, try the following:
  2118.     1. Check to see that the function is a good model of your data.
  2119.         Set $i$plot_each_fit$i$ to true before fitting to see if the function you are 
  2120.         trying to fit adequately represents your data.
  2121.     2. Try changing the initial values of the fit parameters.
  2122.         Don't use 0.0 for initial guesses.  Use 0.1 or 0.0001 instead.
  2123.         Plot your initial guesses to see if they are reasonable or set $i$plot_each_fit$i$ 
  2124.         to true before fitting.
  2125.     3. Make sure all the coefficients of your function are distinguishable.
  2126.         You should not be able to algebraically combine two parameters into one.  
  2127.         For example, if a function contains two constants or two identical terms, 
  2128.         you can combine them as one.
  2129.     4. Make sure that the best value for any parameter in your model is not             infinity.
  2130.  
  2131. FITTING ERRORS:
  2132. (1) SINGULAR MATRIX:
  2133. The most common error message when fitting an arbitrary function to your data is 
  2134. "Singular Matrix."  Usually this happens when the function you are fitting does not have 
  2135. a unique solution.  If Asymptote reports a singular matrix error, first try the steps 
  2136. above; then check to make sure that changing each parameter of the function has some 
  2137. effect on the fitting function.
  2138.  
  2139. (2) OVERFLOW, UNDERFLOW or DIVIDE BY ZERO:
  2140. Asymptote may encounter a numerical error such as an overflow, underflow or a 
  2141. division by zero when it evaluates the fitting function and its partial derivatives.  
  2142. Because Asymptote uses extended double precision for all of its computations, this 
  2143. usually does not happen unless the fitting process has arrived at extreme values.  
  2144. It can happen however, if the function has singularities in the range of x values.  
  2145. After trying the steps above, try shifting or scaling the values in the x vectors 
  2146. to values near zero.
  2147.  
  2148. SEE ALSO:
  2149. $b$rpn$b$
  2150. $b$plotline$b$
  2151.  
  2152. EXAMPLES:
  2153. % Polynomial fitting:
  2154.  
  2155. readcol x 1            % read x data
  2156. readcol y 2            % read y data
  2157. pointsymbol 4 cross
  2158. plotpoints            % plot the input data
  2159. readcol e 3            % read the errors of the points
  2160. ploterrors top            % plot vertical error bars in both directions
  2161. ploterrors bottom
  2162. fitxy 2                % calculate a quadratic fit
  2163. rpn <x 2 y^x a2 * <x a1 * + <a0 + >y   % calculate  y = a0 + a1 x + a2*x^2
  2164. plotline            % plot the result as a line
  2165. title Fit Results: a0 = \a0, a1 = \a1, a2 = \a2
  2166.  
  2167. % Fitting a Gaussian:
  2168. datafile mydata
  2169. readcolumn x 1
  2170. readcolumn y 2
  2171. readcolumn e 3
  2172. graphlimits
  2173. plotpoints
  2174.  
  2175. % Estimate initial values:
  2176. set a0 5              % constant
  2177. set a0fixed no
  2178. set a1 0.01              % slope
  2179. set a1fixed no
  2180. set a2 10              % gaussian 1 center
  2181. set a2fixed yes        % Fix the value of the center
  2182. set a3 4              % gaussian 1 width
  2183. set a3fixed no
  2184. set a4 100              % gaussian 1 amp
  2185. set a4fixed no
  2186. set plot_each_fit yes        % Plot each iteration of the fit
  2187. % Fit the data:
  2188. fitxy 5 a0 x a1 * + x a2 - a3 / 2 y^x -1 * e^x a4 * + 
  2189. % Calculate the fit:
  2190. rpn a0 <x a1 * + <x a2 - a3 / 2 y^x -1 * e^x a4 * + >y
  2191. % And plot the fit:
  2192. plotline
  2193.  
  2194. $$fontname
  2195. fontname
  2196. Set the font for graph labels
  2197.  
  2198. ARGUMENTS: 
  2199. fontname   ± the name of the new graph font
  2200.  
  2201. DESCRIPTION:
  2202. Use $b$fontname$b$ to select the font for drawing graph labels.  Select Set>Font to view a 
  2203. list of the fonts installed in your system.
  2204.  
  2205. Asymptote uses the current value of the scale factor (set with the $b$scale$b$ command) 
  2206. when drawing the labels.  A scale factor of 1 produces characters at the default size set
  2207. with $b$fontsize$b$.  Asymptote also rotates all labels (except for the title, and the 
  2208. $i$x$i$ and $i$y$i$ axis labels) by the amount you specify with the $b$rotation$b$ command.  
  2209. A rotation of 0 degrees produces labels parallel to the $i$x$i$ axis.  You can rotate 
  2210. labels through any angle, but only labels rotated by 0, 90, 180, or 270 degrees will 
  2211. print on all printers.  Asymptote draw labels rotated by angles other than 0, 90, 180 
  2212. or 270 degrees as gray rectangles.  This is called ¾greeking.à  Greeked labels only 
  2213. print correctly on PostScript printers.
  2214.  
  2215. SEE ALSO:
  2216. $b$fontsize$b$ $b$scale$b$ $b$rotation$b$
  2217. $b$drawframe$b$ $b$drawlabel$b$ $b$drawxlabel$b$ $b$drawylabel$b$ $b$drawtitle$b$ $b$plotlabels$b$ 
  2218. $b$pencolor$b$ 
  2219. $b$textmode$b$
  2220.  
  2221. EXAMPLES:
  2222. fontname Helvetica         % set the font for labels and text to helvetica
  2223. fontsize 12        % make 12 pt the default
  2224. scale 2.0             % draw letters at 24 pt
  2225. drawlabel center This is a test label in Helvetica 24 pt
  2226.  
  2227. fontname Times
  2228. rotation 45
  2229. drawlabel left I'm a Times labels rotated by 45¡
  2230. $$fontsize
  2231. points
  2232. Set the point symbol to use when drawing points
  2233.  
  2234. ARGUMENTS: 
  2235. points        ± text size when scale = 1.0 (in points)
  2236.  
  2237. Use $b$fontsize$b$ to set the size (in points) that you want Asymptote to use for labels 
  2238. when the scale factor is set to 1.0.  The $b$fontsize$b$ command is a handy way to adjust 
  2239. the size of your labels without having to change $b$scale$b$ every time you draw text.
  2240.  
  2241. The default text size is 12 points.  Put the $b$fontsize$b$ command in your Start Up 
  2242. script if you want to change this default.
  2243.  
  2244. SEE ALSO:
  2245. $i$graphics environment$i$
  2246. $b$drawframe$b$ $b$drawlabel$b$ $b$drawxlabel$b$ $b$drawylabel$b$ $b$drawtitle$b$ $b$plotlabels$b$ 
  2247.  
  2248. EXAMPLES:
  2249. pointsize 6    % set the point size to 6 points
  2250. scale 1
  2251. plotpoints    % draw points that are 6 points in diameter
  2252. scale 2
  2253. plotpoints    % draw 12 pt points
  2254.  
  2255. $$for
  2256. variable from start to stop [ by step ] do command
  2257. Repeat a command while incrementing or decrementing a variable
  2258.  
  2259. ARGUMENTS: 
  2260. variable      ± the user variable to increment or decrement
  2261. start         ± an expression for the starting value
  2262. end        ± an expression for the ending value
  2263. step        ± an expression for the amount to increment or decrement with each step
  2264. command     ± the command to execute each time through the loop
  2265.  
  2266. DESCRIPTION: 
  2267. Use $b$for$b$ to repeat a command over and over again while Asymptote increments or 
  2268. decrements a user variable.  You can use the value of the user variable in a script to read 
  2269. data from a sequence of numbered data files or to run a sequence of numbered scripts.
  2270.  
  2271. Following the $b$for$b$ command, you must specify the name of the user variable you 
  2272. want to loop.  If there is no user variable with the name you specify, Asymptote 
  2273. automatically creates one for you.  Next, type the word ¾fromà followed by an expression 
  2274. for the starting value of the variable.  After the starting value expression, type ¾toà
  2275. followed by an expression for the ending value of the variable.  These expressions could
  2276.  simply be constants (for example, for i from 1 to 10).  You can also use more complicated 
  2277. expressions involving other variables or constants (for example, for i from j 2 + to k 1 -).
  2278.  
  2279. Following the ending expression, you can (optionally) specify a step expression that 
  2280. Asymptote uses to increment or decrement the user variable.  To specify a step expression, 
  2281. follow the stop expression by the word ¾byà followed by the step expression.  For 
  2282. example, for i from 100 to 0 by˚-1 steps the variable i down from 100 to 0 in steps of
  2283. -1.  If you don't specify a step expression, Asymptote uses the expression 1 to increment
  2284. the variable by 1 each time through the loop.
  2285.  
  2286. Finally, type ¾doà followed by the command you want to execute each time through the 
  2287. loop.  You can pass arguments to the command on the rest of the line.
  2288.  
  2289. SEE ALSO:
  2290. $b$if$b$
  2291. $b$while$b$
  2292. $b$repeat$b$
  2293.  
  2294. EXAMPLES:
  2295. % A simple loop:
  2296.     for i from 1 to 10 do myScript
  2297.  
  2298. % Step myVal from 10 to 0 by 1 and execute nextGraph:
  2299.     for myVal from 10 to 0 by -1 do nextGraph
  2300.  
  2301. % Step i from 1 to 64 by powers of 2
  2302.     for i from 1 to 64 by i 2 * do nextpower i
  2303.  
  2304. % Stop looping when i > j
  2305.     for i from 0 to j do myLoop 
  2306. $$fullscreen
  2307. [ on/off ]
  2308. Expand the $i$Graph Window$i$ to fill the full screen
  2309.  
  2310. ARGUMENTS: 
  2311. on/off        ± if true, expand the $i$Graph Window$i$ to fill the  screen and hide the menus
  2312.               else, shrink the $i$Graph Window$i$ back to its original size and show the menus
  2313.  
  2314. DESCRIPTION: 
  2315. Use $b$fullscreen$b$ to turn Asymptoteàs full screen mode on or off.  Full screen mode is 
  2316. useful if you are taking pictures of the screen or making a presentation.
  2317.  
  2318. When you turn full screen mode on, Asymptote hides the menu bar and expands the graph 
  2319. to fill the entire screen.  When you turn full screen mode off, Asymptote shrinks the
  2320. $i$Graph Window$i$ back to its original size and makes the menu bar visible again.  To toggle
  2321. between these two modes, issue the $b$fullscreen$b$ command without an argument.
  2322. If you specify the full screen mode you want, you may find it convenient to use the
  2323. Asymptote constants ¾onà and ¾offà.
  2324.  
  2325. All of Asymptoteàs features function normally in full screen mode.  If you type something 
  2326. with the keyboard, Asymptote makes the $i$Command Window$i$ visible.  You can then type 
  2327. the rest of the command and execute it.  Even though the menu bar is not visible in full 
  2328. screen mode, you can still issue menu commands.  Simply type the command key 
  2329. equivalent of a command or type command-.(period).  Asymptote makes the menu bar 
  2330. visible and executes the command.  To hide the menu bar again, type
  2331.     fullscreen on
  2332. in the $i$Command Window$i$.
  2333.  
  2334. While you are in full screen mode you can scroll and zoom the graph with the mouse.
  2335. This is a handy way to position the graph exactly as you want it positioned.  Hold down
  2336. the option key and click and drag on the graph to scroll it.  Hold down the command key
  2337. and click to zoom in.  Hold down the command and option keys together and click to zoom
  2338. out.  To zoom the graph to display the graph frame or the entire page, use $b$showgraph$b$ or 
  2339. $b$showpage$b$.  To zoom the graph to a particular zoom factor, you can type $b$zoomgraph$b$
  2340. in the $i$Command Window$i$.
  2341.  
  2342. The background in the $i$Graph Window$i$ is normally white.  If you are taking pictures of the 
  2343. screen or making a presentation, you may want to use $b$backcolor$b$ to change the 
  2344. background color of the $i$Graph Window$i$.
  2345.  
  2346. SEE ALSO:
  2347. $b$showgraph$b$
  2348. $b$showpage$b$
  2349. $b$zoomgraph$b$
  2350. $b$backcolor$b$
  2351.  
  2352. EXAMPLES:
  2353. backcolor 80 80 80    % set the background color to a light gray
  2354. fullscreen on        % expand the $i$Graph Window$i$ to full screen
  2355.  
  2356. fullscreen        % toggle between full screen mode on or off
  2357.  
  2358. fullscreen off        % turn full screen mode off and display the menu bar
  2359. $$graphaspect
  2360. ratio
  2361. Set the aspect ratio of the graph
  2362.  
  2363. ARGUMENTS: 
  2364. ratio        ± the aspect ratio, y scale  = ratio * $i$x$i$ scale
  2365.  
  2366. DESCRIPTION: 
  2367. Use $b$graphaspect$b$ to fix the aspect ratio of the $i$x$i$ and $i$y$i$ axes.
  2368.  
  2369. The $b$graphaspect$b$ command is particularly useful when you are making log-log 
  2370. graphs and want the number of decades per inch on the $i$x$i$ and $i$y$i$ axes to agree.  
  2371. When the scale of the $i$x$i$ and $i$y$i$ axes is the same, the aspect ratio is 1 and the 
  2372. slope, a, of a line on your graph (y = a*x) is also the exponent in the power-law that
  2373. relates $i$x$i$ and $i$y$i$ (y = xa).  The $b$graphaspect$b$ command is also useful when you 
  2374. are creating linear graphs and want them to have a square grid.  When you use 
  2375. $b$graphaspect$b$ to set the aspect radio of your graph to 1, the $i$x$i$ and $i$y$i$ axes 
  2376. have the same number of tick marks per inch and $b$drawgrid$b$ produces a square 
  2377. coordinate grid.
  2378.  
  2379. Note that $b$graphaspect$b$ works by adjusting the size of the graph frame, not the limits 
  2380. of your graph.  Before you use $b$graphaspect$b$, you must set the limits of your graph 
  2381. with $b$graphlimits$b$ and position the graph frame on the page with $b$graphframe$b$.  
  2382. When you issue the $b$graphaspect$b$ command, Asymptote adjusts the width or the 
  2383. height of the graph frame so that the aspect radio is the ratio you specified.  Asymptote
  2384. also tries to make the new frame fit inside the old.  Now you are ready to draw the axes
  2385. of the graph with $b$drawframe$b$ or $b$drawaxis$b$ and plot your data.
  2386.  
  2387. SEE ALSO:
  2388. $b$graphlimits$b$
  2389. $b$graphframe$b$
  2390. $b$graphunits$b$
  2391. $b$graphticks$b$
  2392. $b$drawframe$b$ $b$drawaxis$b$
  2393.  
  2394. EXAMPLES:
  2395. graphlimits 5 25 -10 10    % set the graph limits
  2396. graphaspect 1.0        % make the y axis scale the same as x
  2397. drawframe
  2398.  
  2399. graphticks -1 0 -1 0        % use log-log tick marks
  2400. graphlimits 0 5 1 4        % 1 to 105 in x; 10 to 104 in y
  2401. graphaspect 1.0        % plot the same number of decades per inch
  2402. drawframe            % on the x and y axes
  2403.  
  2404. graphlimits 0 100 0 100
  2405. graphaspect 2.0        % make y have twice the scale as x
  2406. $$graphframe
  2407. gleft gright gbottom gtop
  2408. Set the position of the graph frame on the page
  2409.  
  2410. ARGUMENTS: 
  2411. gleft        ± left side of the frame in page coordinates
  2412. gright        ± right side of the frame in page coordinates
  2413. gbottom    ± bottom of the frame in page coordinates
  2414. gtop        ± top of the frame in page coordinates
  2415.  
  2416. DESCRIPTION: 
  2417. Use $b$graphframe$b$ to position the graph frame on the page.  The $b$graphframe$b$ 
  2418. command uses page coordinates with the origin (0,0) in the lower left of the page.  You
  2419. can use $b$graphunits$b$ to choose which units you want to use for page coordinates (inches, 
  2420. cm, or points).
  2421.  
  2422. Keep in mind that the dimensions of the page are stored in the Asymptote variables \pleft, 
  2423. \pright, \pbottom and \ptop.  You can use these to specify the position of the graph on the 
  2424. page.  For example, to set the graph frame to fill the page with a 1 inch margin use the 
  2425. following commands:
  2426.  
  2427. graphunits in
  2428. graphframe pleft 1 + pright 1 - pbottom 1 + ptop 1 -
  2429. drawframe
  2430.  
  2431. SEE ALSO:
  2432. $i$Variables$i$ 
  2433. $b$graphunits$b$
  2434. $b$drawframe$b$
  2435. $b$drawaxis$b$
  2436.  
  2437. EXAMPLES:
  2438. graphframe ?                % choose the graph frame interactively
  2439.  
  2440. graphunits cm
  2441. graphframe 5 5 15 15        % a 10 cm by 10 cm graph 
  2442.  
  2443. graphunits inches
  2444. graphframe 2 2 ptop 2 - pright 2 -        % draw a graph with a 2 inch margin
  2445.  
  2446. % Shift the graph frame up by the current height of the graph plus one inch:
  2447. graphunits inches
  2448. set vertoffset gtop gbottom - 1 +
  2449. graphframe vertoffset gbottom + gleft vertoffset gtop + gright
  2450. drawframe inside nolabels nolabels nolabels nolabels
  2451. $$graphlimits
  2452. [ xleft xright ybottom ytop ]
  2453. Set the limits of the graph 
  2454.  
  2455. ARGUMENTS: 
  2456. xleft        ± x value at left side of the graph
  2457. xright        ± x value at right side of the graph
  2458. ybottom    ± y value at bottom of the graph
  2459. ytop        ± y value at the top of the of the graph
  2460.  
  2461. DESCRIPTION: 
  2462. Use $b$graphlimits$b$ to set the $i$x$i$ and $i$y$i$ limits of your graph.  Asymptote uses these
  2463. limits for all subsequent plotting and drawing.
  2464.  
  2465. To have Asymptote choose the limits of your graph for you, use $b$graphlimits$b$ command
  2466. without arguments.  Asymptote chooses limits that make all the points visible.
  2467.  
  2468. To set the limits of the graph you must specify all four arguments to the $b$graphlimits$b$ 
  2469. command.  The first and second arguments are the $i$x$i$ values at the left and right sides 
  2470. of the graph frame.  The third and fourth arguments are the $i$y$i$ values at the bottom 
  2471. and top of the frame.  If you want the $i$x$i$ or the $i$y$i$ axis to run 'backward' (increasing
  2472. from left to right or increasing from top to bottom) just specify the larger axis 
  2473. limit first.  See the example below.
  2474.  
  2475. If you want to specify the limits for one axis, but have Asymptote choose the limits of the 
  2476. other axis for you, specify 0 0 for the limits of the axis you want Asymptote to adjust.
  2477. For example, if you type the command
  2478.     graphlimits 3 4 0 0
  2479. Asymptote sets the $i$x$i$ axis to range from 3 to 4 and chooses the $i$y$i$ axis limits
  2480. automatically.
  2481.  
  2482. SEE ALSO:
  2483. $b$drawframe$b$
  2484. $b$drawaxis$b$
  2485.  
  2486. EXAMPLES:
  2487. graphlimits                % set the limits automatically for both x and y
  2488.  
  2489. graphlimits 2 5 2.4 9        % set x limits to range from 2 to 5 and y from 2.4 to 9
  2490.  
  2491. graphlimits 0 0 1 12            % choose x automatically, set y limits to 1 to 12
  2492.  
  2493. graphlimits                % choose limits automatically
  2494. graphlimits 0 xright ybottom ytop    % then fix xleft to be 0.0
  2495.  
  2496. graphlimits 1 -1 0 10        % x runs 'backward' from 1 to -1; y from 0 to 10 
  2497.  
  2498. graphlimits                    % first have Asymptote choose limits
  2499. graphlimits xleft xright ytop ybottom      % then flip the y axis 'upside down'
  2500. $$graphticks
  2501. [ xminor xmajor yminor ymajor ]
  2502. Set the spacing of major and minor tick marks
  2503.  
  2504. ARGUMENTS: 
  2505. xminor, yminor    ± spacing for minor tickmarks in graph coordinates
  2506. xmajor, ymajor    ± spacing for major tickmarks in graph coordinates
  2507.  
  2508. DESCRIPTION: 
  2509. Use $b$graphticks$b$ to set the intervals for major and minor tick marks.  ¾Minorà refers 
  2510. to the interval between small tick marks and ¾majorà refers to the interval between
  2511. large tick marks.  To have Asymptote choose the tick spacing for you, use $b$graphticks$b$ 
  2512. with no arguments.  Specify 0 for xmajor or ymajor to have Asymptote choose the
  2513. tick spacing of one axis while you specify the tick spacing of the other.
  2514.  
  2515. To draw logarithmic minor tick marks and major tick marks at each decade, set xminor
  2516. or yminor to a negative value.  For example, use xminor = -1 and xmajor = 0 to draw a 
  2517. logarithmic $i$x$i$ axis and let Asymptote choosing the spacing for the major tick spacing 
  2518. (about one major tick every inch).  To specify the tick spacing directly, set xminor to
  2519. the spacing in decades for minor tick marks and xmajor to the number of decades
  2520. between major tick marks.  For example, use xminor = -0.5 and xmajor = -2 to draw
  2521. minor ticks every half decade and major tick marks every 2nd decade.
  2522.  
  2523. When you plot log-log graphs, Asymptote plots the values in the $i$x$i$ and $i$y$i$ vectors directly
  2524. and doesnàt take the logarithm of them before plotting the points.  When you make
  2525. a log-log or log-linear graph,  use $b$rpn$b$ to calculate the replace the values 
  2526. in you $i$x$i$ and $i$y$i$ vectors before plotting them.
  2527.  
  2528. SEE ALSO:
  2529. $b$graphlimits$b$
  2530. $b$drawframe$b$
  2531. $b$drawaxis$b$
  2532. $b$drawgrid$b$
  2533. $b$rpn$b$
  2534.  
  2535. EXAMPLES:
  2536. graphticks .5 1 20 100  % small x ticks every .5 units of x, big ticks every 1 in x
  2537.                  % small y ticks every 20 units of y, big ticks every 100
  2538.  
  2539. readcol x 1
  2540. readcol y 2
  2541. rpn <x log >x            % replace the x values with their logs
  2542. rpn <y log >y            % do the same for y
  2543. graphlimits 1 3 -1 1        % x decades from 1 to 3, y from decades -1 to 1
  2544. graphticks -1 0 -1 0     % log ticks on both axes
  2545. drawframe
  2546.  
  2547. readcol x 1
  2548. readcol y 2
  2549. rpn <y log >y            % calculate log of y
  2550. graphlimits 1 3 -1 1     % x runs from 1 to 3
  2551.                 % y limits from  10^-1 to 10^1
  2552. graphticks 0 0 -1 0         % choose x ticks automatically, y ticks are logarithmic
  2553. drawframe
  2554.  
  2555. graphticks ?            % choose tick spacing via a dialog box
  2556. $$graphunits
  2557. unitname
  2558. Set the units for measuring page coordinates
  2559.  
  2560. ARGUMENTS: 
  2561. unitname     ± unit name (inches, centimeters, or points)
  2562.  
  2563. DESCRIPTION: 
  2564. Use $b$graphunits$b$ to specify the units you want to use for page coordinates.  Specify 
  2565. either 'inches,' 'cm' or 'points' or the abbreviations 'in,' 'cm' or 'pts.'  After you change 
  2566. the units with $b$graphunits$b$, all subsequent commands that take page coordinates as 
  2567. arguments (for example $b$graphframe$b$) assume that arguments you give them are in 
  2568. the new units.  The Status and Variables Windows also display all quantities in page 
  2569. coordinates using the units you have specified with $b$graphunits$b$.
  2570.  
  2571. SEE ALSO:
  2572. $i$Constants$b$
  2573. $b$graphframe$b$
  2574.  
  2575. EXAMPLES:
  2576. graphunits cm
  2577.  
  2578. graphunits inches
  2579. graphframe 2 4 4 8     % 2 to 4 inches in x, 4 to 8 inches in y
  2580. drawframe
  2581. $$help
  2582. [ command ]
  2583. TO USE ASYMPTOTE'S ON-LINE HELP:
  2584. ¥ Type 'help' in the $i$Command Window$i$:
  2585.  
  2586. ¥ To get help on a particular command, type
  2587.     help commandName
  2588.  
  2589. ¥ To get help on a menu command or window:
  2590.     Press the command (clover leaf) and ? keys together to activate help cursor.
  2591.     Then, select a menu command or click a window with the mouse.
  2592.  
  2593. ¥ Select a help topic from the Help menu under the Apple Menu
  2594.  
  2595. ¥ Select ¾Helpà from the Window menu  Window>Help or type command-H
  2596.  
  2597. ¥ Click the Help button when an error message appears.
  2598. <<<  Click on the scroll bar for more information <<<<<<<<<<
  2599.  
  2600. Use the left and right arrow keys in the lower left corner of this window to move 
  2601. between entries in the help file.  Each help entry has a title (usually a command 
  2602. name) followed by a list of arguments.  Optional arguments are enclosed in square 
  2603. brackets [].
  2604.  
  2605. For a complete description of how to use on-line help file, see the section titled
  2606. ¼Using the Help Window½ in Chapter 3 of the Asymptote Useràs Guide.
  2607. $$hidewindow
  2608. [ windowname ]
  2609. Make a window invisible
  2610.  
  2611. ARGUMENTS: 
  2612. windowname    ± the name of the window to hide
  2613.  
  2614. DESCRIPTION:
  2615. Use $b$hidewindow$b$ to make a window invisible and reduce screen clutter.  You can 
  2616. also hide a window by clicking on its close box while holding down the option key.  To 
  2617. make a hidden window visible again, use $b$showwindow$b$ or select the window from 
  2618. the $i$Windows menu$i$.
  2619.  
  2620. Hiding a window does not release the memory is occupies.  To close a window and release 
  2621. the memory it occupies, use $b$closewindow$b$ rather than $b$hidewindow$b$.
  2622.  
  2623. If you donàt specify the window you want to hide, Asymptote hides the currently active 
  2624. window.  You can also use \f and \r to hide the Data and Recorder Windows respectively.
  2625.  
  2626. SEE ALSO:
  2627. $b$showwindow$b$  $b$closewindow$b$
  2628.  
  2629. EXAMPLES:
  2630. hide        % hide this window
  2631. set test ?You can't see me!
  2632. show        % make this window visible again
  2633.  
  2634. hidewindow test data    % make the window 'test data' invisible
  2635.  
  2636. hidewindow \f        % hide the current data file window
  2637.  
  2638. hidewindow \r        % hide the current Recorder Window
  2639. $$if
  2640. expression then command1 [ else command2 ]
  2641. Execute a command based on the result of a logical test  
  2642.  
  2643. ARGUMENTS: 
  2644. expression    ± a logical expression resulting in a single value which is either
  2645.             true (›0) or false (=0) 
  2646. command1    ± the command or macro to execute if the expression is true
  2647. command2    ± the command or macro to execute if the expression is false
  2648.  
  2649. DESCRIPTION: 
  2650. Use the $b$if$b$ command to control the execution of your scripts based on logical tests.  
  2651. For example, if you want to draw the $i$x$i$ and $i$y$i$ points as filled squares only if the
  2652. number of points is greater than 100, you could use:
  2653.     if npts 100 > then pointsymbol 4 filled
  2654.     plotpoints
  2655. In this example, Asymptote puts the number of points (npts) and the constant 100 on the 
  2656. arguments stack.  It then compares them with the > operator to produce a result that is 
  2657. either true (1) or false (0).  If the result is true, Asymptote executes $b$pointsymbol$b$ 
  2658. to set the point symbol to filled squares.
  2659.  
  2660. The logical operators you can use in $b$if$b$ expressions are:
  2661.     <    less than
  2662.     >    greater than
  2663.     =    equal
  2664.     <=    less than or equal to
  2665.     >=    greater than or equal to
  2666.     <>    not equal
  2667. Remember, you don't have to use a logical operator in every expression.  Asymptote 
  2668. simply evaluates the expression and tests to see if it is true (›0) or false (=0).
  2669.  
  2670. Your logical expression must be followed with the word 'then' followed by a command or 
  2671. macro name.  Optionally, you can follow the command with the keyword 'else' and an 
  2672. alternate command to be executed if the logical expression is false.   For example the 
  2673. command
  2674.     if x(10) 34.9 / 10 < then script1 else script2
  2675. executes 'script1' if x(10)/34.9 is less than 10; otherwise 'script2' is executed.
  2676.   
  2677. SEE ALSO:
  2678. $b$rpn$b$  $b$repeat$b$  $b$while$b$
  2679.  
  2680. EXAMPLES:
  2681. % Draw filled squares if the variable 'drawsquares' is true, else draw open triangles:
  2682. if drawsquares then pointsymbol 4 filled else pointsymbol 3 open
  2683.  
  2684. % If the left axis limit is less than 100, set it to be 100 and leave the rest of the
  2685. %    axis limits unchanged.
  2686. if xleft 100 < then graphlimits 100 xright ybottom ytop
  2687. $$moveto
  2688. x y
  2689. Move the graph pen to a new x, y coordinate (in graph coordinates)
  2690.  
  2691. ARGUMENTS: 
  2692. x        ± x coordinates of new pen position
  2693. y        ± y  coordinates of the new pen position
  2694.  
  2695. DESCRIPTION: 
  2696. Use $b$moveto$b$ to move the graph pen to a new position on your graph.  The coordinates 
  2697. you specify are measured in graph coordinates.  Remember that $b$moveto$b$ only 
  2698. positions the pen; it doesn't draw on the graph.  Use $b$drawto$b$ if you want to draw a line
  2699. from the old pen position to the new position.
  2700.  
  2701. To move the graphics pen using the graph cursor, type 
  2702.     moveto ?
  2703. in the $i$Command Window$i$, or select Plot>Move To.  Asymptote activates the graph cursor 
  2704. which you can use to specify the new pen position.  When you click the mouse, Asymptote 
  2705. enters the $b$drawto$b$ command in your $i$Recorder Window$i$.  Using the graph cursor this 
  2706. way is particularly useful when you are placing labels on your graph.
  2707.  
  2708. SEE ALSO:
  2709. $b$drawto$b$
  2710. $b$cursor$b$
  2711. $b$graphlimits$b$
  2712.  
  2713. EXAMPLES:
  2714. moveto 2.0E10 1929.2        % move to (x, y) = (2E10, 1929.2) on the graph
  2715.  
  2716. moveto ?                % position the pen interactively with the mouse
  2717.  
  2718. moveto xleft xright + 2 / ybottom ytop + 2 /       % move to the center of the graph
  2719.  
  2720. moveto x(10) y(10) 5 +         % position the pen 5 units of y above the 10th point
  2721. drawlabel left This is point #10
  2722.  
  2723. moveto ?            % get the starting position of a line
  2724. drawto ?            % draw to a line to this position
  2725. drawarrowto ?        % draw and arrow to the next position
  2726.  
  2727. moveto ?            % move to the starting position
  2728. repeat 10 times drawto ?    % draw 10 connected line segments with the mouse
  2729. $$moviefile
  2730. [ filename ]
  2731. Open a new or existing movie file in the $i$Movie Window$i$
  2732.  
  2733. ARGUMENTS: 
  2734. filename    ± the name of the movie file to open
  2735.  
  2736. DESCRIPTION: 
  2737. To create a new, empty movie file, use $b$moviefile$b$ without an argument.  When you 
  2738. create a new movie, Asymptote uses the current size of the $i$Graph Window$i$ for the 
  2739. dimensions of the movie.  To create a movie with a different size, resize the Graph 
  2740. Window to the size you want before you create a new movie.  To open an existing movie 
  2741. file, specify the movie fileàs name after the $b$moviefile$b$ command.
  2742.  
  2743. Asymptote opens movie files in the $i$Movie Window$i$.  You can play them using the controls 
  2744. as the bottom of the $i$Movie Window$i$.  You can add a frame to the end of a movie with 
  2745. $b$movieframe$b$.
  2746.  
  2747. To use the $b$moviefile$b$ command, you must install the QuickTime extension in your 
  2748. system.  Follow the instructions in Appendix G to install QuickTime if the 
  2749. $b$moviefile$b$ command tells you that QuickTime is not installed.  If you plan to create 
  2750. lots of movies, especially color movies, you may also want to use the Finder to increase 
  2751. amount of the memory allocated to Asymptote.
  2752.  
  2753. SEE ALSO:
  2754. $b$movieframe$b$
  2755.  
  2756. EXAMPLES:
  2757. moviefile        % create a new movie file on disk
  2758.  
  2759. moviefile MyMovie    % open the existing movie ¾MyMovieà in the Movie Window
  2760. $$movieframe
  2761.  
  2762. Add a frame to the  end of the movie in the $i$Movie Window$i$
  2763.  
  2764. ARGUMENTS: 
  2765. none
  2766.  
  2767. DESCRIPTION: 
  2768. Use $b$movieframe$b$ to copy the contents of the $i$Graph Window$i$ to a new frame at the end
  2769. of the movie in the Movie Window.
  2770.  
  2771. You can only use $b$movieframe$b$ after  you have opened a movie with the $b$movieframe$b$
  2772. command.
  2773.  
  2774. SEE ALSO:
  2775. $b$moviefile$b$
  2776.  
  2777. EXAMPLES:
  2778. movieframe             % add a frame to the end of the movie in the Movie Window
  2779. $$newwindow
  2780.  
  2781. Open a new Text Editor Window
  2782.  
  2783. ARGUMENTS: 
  2784. none
  2785.  
  2786. DESCRIPTION: 
  2787. The $b$newwindow$b$ command, which is the same as selecting File>New, opens a new, 
  2788. untitled Text Editor Window.  You can use the window to write a script or to enter data.  
  2789. To make the new window the $i$Recorder Window$i$, select its name in the File>Recorder
  2790. menu.  To make the new window the current $i$Data Window$i$, select its name in the 
  2791. File>Data menu.
  2792.  
  2793. SEE ALSO:
  2794. $b$closewindow$b$
  2795. $b$hidewindow$b$  $b$showwindow$b$  
  2796. $i$Data menu$i$
  2797. $i$Recorder menu$i$
  2798. $$notation
  2799. [ format ]
  2800. Set the notation format labels
  2801.  
  2802. ARGUMENTS: 
  2803. format    ± a value indicating the notation format to use for labels
  2804.         decimal    (=-2)
  2805.         float        (=-1)    
  2806.         general    (= 0)
  2807.         default     (= 1)
  2808.         scientific    (= 2)
  2809.         hhmmss    (= 3)
  2810.         ddmmss    (= 4)
  2811.     (see examples below)
  2812.  
  2813. DESCRIPTION: 
  2814. Use the $b$notation$b$ command to select what notation scheme Asymptote should use 
  2815. when converting numbers into labels.  The $b$notation$b$ and $b$digits$b$ commands 
  2816. work together to select the format and the number of digits that should be displayed.
  2817. If you want to have Asymptote convert numbers to labels automatically, use
  2818.     digits 0
  2819.     notation general
  2820. If you want greater control over how many decimal places to use or want to force 
  2821. Asymptote to use a particular notation, then specify $b$notation$b$ and $b$digits$b$ before
  2822. you draw a label.
  2823.  
  2824. Asymptote uses the current value of $b$digits$b$ when it draws labels which contain 
  2825. variables or constants.  For most notation formats $b$digits$b$ selects the number of 
  2826. significant digits you want to display in the number.  Use $b$digits$b$= 0 if you want to 
  2827. show all the digits in a number.  For the 'decimal' notation ($b$notation$b$ = -2), 
  2828. $b$digits$b$ specifies how many digits should be printed $i$after$i$ the decimal point.  
  2829. With 'decimal' notation set $b$digits$b$ to a large number (say >10) if you want to show 
  2830. all digits.
  2831.  
  2832. The following examples show how Asymptote converts the value 123.456789 to a label 
  2833. using a variety of notation formats.
  2834.  
  2835. $b$notation$b$        $b$digits$b$        Label
  2836. decimal        4        123.4568
  2837.             2        123.46
  2838.             0        123
  2839. For the ¾decimalà notation, $b$digits$b$ is the number of digits to display after the decimal 
  2840. point.  If the value is 0, the ¾decimalà notation displays ¼0.0½ unless $b$digits$b$ is 0, in 
  2841. which case a ¼0½ with no decimal point is displayed.
  2842.  
  2843. $b$notation$b$        $b$digits$b$        Label
  2844. float            4        123.5
  2845.             2        123
  2846.             0        123.456789
  2847. For the ¾floatà notation, $b$digits$b$ is the number of significant digits to display.  The 
  2848. float notation always displays ¼0½ if the value is 0.
  2849.  
  2850. $b$notation$b$        $b$digits$b$        Label
  2851. general        4        123.5
  2852.             2        123
  2853.             0        123.456789
  2854. The ¾generalà format uses ¾scientificà notation if the value is greater than 1˚x10^6, 
  2855. otherwise the ¾floatà notation is used.  The general notation always displays ¼0½ if the
  2856. value is 0.
  2857.  
  2858. The ¾defaultà notation always uses scientific notation:
  2859. $b$notation$b$        $b$digits$b$        Label
  2860. default            4        1.235˚x˚10^2
  2861.             2        1.2˚x˚10^2
  2862.             0        1.23456789˚x˚10^2
  2863. For the ¾defaultà notation, $b$digits$b$ is the number of significant digits in the mantissa.  
  2864. The default notation always displays ¼0½ if the value is 0.
  2865.  
  2866. The ¾scientificà notation uses scientific notation: 
  2867. $b$notation$b$        $b$digits$b$        Label
  2868. scientific        4        1.235˚x˚10^2
  2869.             2        1.2˚x˚10^2
  2870.             0        1.23456789˚x˚10^2
  2871. For the ¾scientificà notation, $b$digits$b$ is the number of significant digits in the mantissa.
  2872. If the value is 0 and $b$digits$b$is 0, ¾scientificà notation displays ¼0½, otherwise
  2873. ¼0.0½ is displayed.
  2874.  
  2875. The ¾hhmmssà notation displays hour, minutes and seconds:
  2876. $b$notation$b$        $b$digits$b$        Label
  2877. hhmmss        4        123h 27m 24.4s
  2878.             2        123h 27m
  2879.             0        123h 27m 24s
  2880. For the ¾hhmmssà notation, if $b$digits$b$ is 0, the time is displayed with no decimal 
  2881. point in the seconds portion.  If $b$digits$b$ is 1, only the hours are displayed.  If 
  2882. $b$digits$b$ is 2, the hours and minutes are displayed.  If $b$digits$b$ is >3, $b$digits$b$ - 3
  2883. is the number digits to display after the decimal point in the seconds portion
  2884. of the label.  If the value is 0, ¼0h½ is always displayed.
  2885.  
  2886. The ¾ddmmssà notation displays degrees, minutes and seconds:
  2887. $b$notation$b$        $b$digits$b$        Label
  2888. ddmmss        4        123¡27à 24.4àà
  2889.             2        123¡ 27à
  2890.             0        123¡ 27à 24àà
  2891. For the ¾ddmmss notation, if $b$digits$b$ is 0, the angle is displayed with no decimal 
  2892. points in the seconds portion.  If $b$digits$b$ is 1, only the degrees are displayed.  If 
  2893. $b$digits$b$ is 2, the degrees and minutes are displayed.  If $b$digits$b$ is >3, $b$digits$b$ - 3
  2894. is the number digits to display after the decimal point in the seconds portion
  2895. of the label.  If the value is 0, ¼0¡½ is always displayed.
  2896.  
  2897. SEE ALSO:
  2898. $b$digits$b$
  2899. $b$drawlabel$b$
  2900. $b$drawtitle$b$  $b$drawxlabel$b$  $b$drawylabel$b$  $b$drawlabel$b$
  2901.  
  2902. EXAMPLES:
  2903. notation scientific
  2904. digits 4
  2905. drawlabel left x(1)            % if x(1)= 34.373  label = 3.437 x 10^1
  2906. $$npts
  2907. [ n ]
  2908. Set the number of points to plot or calculate
  2909.  
  2910. ARGUMENTS: 
  2911. n    ± the number of points to plot or use in calculations
  2912.  
  2913. DESCRIPTION: 
  2914. Use $b$npts$b$ to set the length of the $i$x$i$, $i$y$i$, $i$p$i$, $i$e$i$ and label vectors.  When you read data with 
  2915. $b$readcolumn$b$ or $b$readrow$b$, Asymptote automatically sets npts to the number of points
  2916. it read.  You can use $b$npts$b$ when you are going to calculate values using the $b$rpn$b$ 
  2917. calculator.  With $b$npts$b$, you can choose the number of points to calculate.
  2918.  
  2919. If you donàt specify the number of points you want, Asymptote sets the number of points 
  2920. to the maximum possible.  Note that changing $b$npts$b$ does not change the amount of 
  2921. memory devoted to Asymptoteàs vectors.  Changing $b$npts$b$ changes the number of 
  2922. points that commands like $b$plotline$b$ use when plotting data.  To change the maximum 
  2923. length of Asymptoteàs vectors use File>Options>Memory˚Use.
  2924.  
  2925. SEE ALSO:
  2926. $b$rpn$b$ 
  2927. $b$datalines$b$
  2928. $b$readcolumn$b$  $b$readrow$b$
  2929. $i$Options$i$
  2930. $i$Memory Use$i$ 
  2931.  
  2932. EXAMPLES:
  2933. %  Calculate y= x*x for x= 1 to 100
  2934. npts 100
  2935. rpn index >x dup * >y    % index puts the numbers 1 through 100 on the stack 
  2936. $$pagesetup
  2937.  
  2938. Adjust the page setup
  2939.  
  2940. ARGUMENTS: 
  2941. none 
  2942.  
  2943. DESCRIPTION: 
  2944. Use the $b$pagesetup$b$ command to read the orientation of the page (landscape or 
  2945. portrait) and other page setup information from the current script.
  2946.  
  2947. To save the page setup information with a script, first select the script from the 
  2948. File>Recorder menu to make it the current Recorder.  Next, choose 
  2949. File>Graph˚Page˚Setup and configure the graph page setup.  To save the page setup to the 
  2950. current Recorder, select File>Graph˚Page˚Setup>Save˚to˚Recorder.
  2951.  
  2952. To read the graph page setup information from your script, add the command
  2953.     pagesetup
  2954. to the script.  When Asymptote encounters the $b$pagesetup$b$ command as it executes 
  2955. the script, it reads the previously saved page setup information as if you had chosen 
  2956. File>Graph˚Page˚Setup from the $i$File$i$ menu.
  2957.  
  2958. Remember that when you change the graph page setup information, Asymptote clears the 
  2959. graph and erases the contents of the $i$Graph Window$i$.  As a result, you should put the page 
  2960. setup command at the beginning of your script $i$before$i$ you begin drawing your 
  2961. graph.
  2962.  
  2963. SEE ALSO:
  2964. $b$print$b$
  2965. $i$File Menu$i$   $i$Graph Page Setup$i$   $i$Save to Recorder$i$
  2966.  
  2967. EXAMPLES:
  2968. pagesetup    %  Read the graph page setup from the Recorder
  2969. DoPlot        %  Then create the graph by running the script ¾DoPlotà
  2970. print        % Print the graph
  2971. $$pencolor
  2972. r g b   or   colorName
  2973. Set the pen color for graphics and text
  2974.  
  2975. ARGUMENTS: 
  2976. r, g, b        ± red green blue color values in percent
  2977. or
  2978. colorName    ± the name of a color
  2979.            (red, green, blue, magenta, yellow, purple, black, white)
  2980.  
  2981. DESCRIPTION: 
  2982. Use $b$pencolor$b$ to change the pen color.  There are two ways you can specify the 
  2983. color you want.  The first is to specify a color by name as in this example:
  2984.     pencolor red
  2985. For greater control, you can also specify a combination of red, green and blue that 
  2986. produces the color you want.  For example, to change the pen color to red use
  2987.     pencolor 100 0 0
  2988. You can specify any color you want by its red, green, and blue component intensities.
  2989.  
  2990. A handy way to choose the pen color is to use Asymptoteàs color wheel.  To use the color 
  2991. wheel, type
  2992.     pencolor ?
  2993. Or select Set>Pen>Color.  Asymptote displays a color wheel so you can select the color 
  2994. you want.  When you click OK, Asymptote adds the $b$pencolor$b$ command followed 
  2995. by the red, green and blue intensities of the color you selected in your Recorder script.
  2996.  
  2997. SEE ALSO:
  2998. $b$penpattern$b$
  2999. $b$pensize$b$
  3000. $b$pendash$b$
  3001. $b$fillpattern$b$
  3002. $i$Variables and Constants$i$
  3003.  
  3004. EXAMPLES:
  3005. pencolor 50 50 50    % gray
  3006. drawframe        % draw a gray frame
  3007.  
  3008. pencolor 10 90 25    % a particular color
  3009.  
  3010. pencolor ?        % Choose a color using a color wheel.  Put this command
  3011.             % in a script to open the color wheel every time it runs.
  3012.             % If you type this command in the $i$Command Window$i$, Asymptote 
  3013. displays
  3014.             % the color wheel.  When you click OK, Asymptote adds the 
  3015. pencolor
  3016.             % command followed by the r, g, b values of the color you selected
  3017.             % to your Recorder script.
  3018. $$pendash
  3019. [ on1 [ off1 ] [ on2 off2 ] [ on3 off3 ] ]
  3020. Set the pen dash pattern (solid, dashed, dotted, etc.) 
  3021.  
  3022. ARGUMENTS:
  3023. n    ± dash pattern lengths (none, 1, 2, 4 or 6 are expected)
  3024.         on1 = length of 1st ON segment
  3025.         off1 = length of 1st OFF segment
  3026.         on2 = length of 2nd ON segment
  3027.         off2 = length of 2nd OFF segment
  3028.         on3 = length of 3rd ON segment
  3029.         off3 = length of 3rd OFF segment
  3030.  
  3031. DESCRIPTION: 
  3032. Asymptote uses the current pendash pattern when it draws points and lines (except 
  3033. when drawing axes).  If you don't specify a dash pattern, a solid line is used.
  3034.  
  3035. You specify the dash pattern by telling Asymptote the lengths of 6 line segments that
  3036. make up the pattern.  The 1st, 3rd and 5th segments are the ¾onà part of the dash
  3037. pattern, while the 2nd, 4th and 6th segments are the lengths of the white space in
  3038. between.  You donàt have to specify all of the segments if you donàt want to.  If you 
  3039. provide only one segment length, Asymptote uses it for all six segments.  If you 
  3040. want to repeat two segments over for the whole pattern, simply specify the on 
  3041. and off segments you want to use.
  3042.  
  3043. You can use the Asymptote constants $i$solid$i$, $i$dot$i$, $i$short$i$ and $i$long$i$ to specify the dash pattern 
  3044. segments.  For example:
  3045.  
  3046. pendash short        % short dashed lines spaced by a short line segment
  3047.  
  3048. pendash long        % same thing but long dashed with long spaces
  3049.  
  3050. pendash long short    % long dashes spaced by short segments
  3051.  
  3052. SEE ALSO:
  3053. $b$pensize$b$
  3054. $b$pencolor$b$
  3055. $b$penmode$b$
  3056. $i$Variables and Constants$i$ 
  3057.  
  3058. EXAMPLES:
  3059. pendash dot        % draw all subsequent lines as dotted lines
  3060.  
  3061. pendash        % use solid lines
  3062.  
  3063. pendash ?        % choose a dash pattern graphically
  3064.  
  3065. pendash long dot dot short short short  % a dash pattern with all 6 segments specified
  3066.  
  3067. pendash 2 1 2 1 4 1               % a particular dash pattern
  3068. $$penmode
  3069. [ n ]
  3070. Set the pen transfer mode for drawing graphics
  3071.  
  3072. ARGUMENTS: 
  3073. n        ± the new pen mode number (1 through 8)
  3074. or
  3075.         ± a mode name  (opaque, transparent, reversed, erase inverted, 
  3076.                     overlay, clear, whiteout)
  3077.  
  3078. DESCRIPTION: 
  3079. Use the $b$penmode$b$ command to select a pen drawing mode.  The pen mode is a number 
  3080. from 1 to 8.  For convenience you can use one of the following constants to specify the 
  3081. mode you want: opaque, transparent, reversed, erase, inverted, overlay, clear, whiteout.
  3082.  
  3083. To choose a mode graphically type:
  3084.     penmode ?
  3085. or select Set>Pen>Mode.  Asymptote displays a dialog box with an illustration of each pen 
  3086. mode.  Click the pen mode you want with the mouse.
  3087.  
  3088. ¥ Note: PostScript printers don't make use of pen transfer modes.  This is a feature of the 
  3089. LaserWriter driver supplied by Apple.  You can only use pen modes on printers that are 
  3090. QuickDraw-based.
  3091.  
  3092. SEE ALSO:
  3093. $i$Variables and Constants$i$
  3094. $b$pencolor$b$  $b$pensize$b$  $b$pensize$b$  $b$pendash$b$  $b$penmode$b$
  3095.  
  3096. EXAMPLES:
  3097. penmode reversed
  3098. drawpoint        % to reverse the pen color where the dot is drawn.
  3099. $$penpattern
  3100. [ penpattern ]
  3101. Set the pen pattern to use when drawing lines
  3102.  
  3103. ARGUMENTS: 
  3104. penpattern    ± a pattern number (0 through 38)
  3105.         or
  3106.         ± a pattern name (none , black, darkgray, gray, lightgray, white, 
  3107.             grid, vertical, horizontal, diagonal, white, bricks)
  3108.  
  3109. DESCRIPTION: 
  3110. Use $b$penpattern$b$ to choose the pattern for pen drawing.  The pen pattern is a number 
  3111. between 0 and 38.  For convenience you can specify one of these named patterns:
  3112.     none, black, darkgray, gray, lightgray, white
  3113.     grid, vertical, horizontal, diagonal, white, bricks
  3114. To choose the pattern for filling points and polygons, and for shading under curves, use 
  3115. the $b$fillpattern$b$ command.
  3116.  
  3117. Remember, that although you can use $b$penpattern$b$ to draw dashed lines, it is better to 
  3118. use $b$pendash$b$ instead.  Lines drawn with dash patterns are true dashed lines: the dash 
  3119. pattern follows the curve of the line.
  3120.  
  3121. SEE ALSO:
  3122. $i$Variables and Constants$i$
  3123. $b$fillpattern$b$
  3124. $b$pencolor$b$  $b$penmode$b$  $b$pensize$b$  $b$pendash$b$
  3125.  
  3126. EXAMPLES:
  3127. % The following commands draw a big, fat, gray X on the graph
  3128. penpattern gray
  3129. pensize 10
  3130. moveto xleft ybottom
  3131. drawto xright ytop
  3132. moveto xleft ytop
  3133. drawto xright ybottom
  3134.  
  3135. penpattern gray
  3136. fillpattern black
  3137. pointsymbol 4 filled       % Draw filled squares with a gray outline and a black center
  3138. $$pensize
  3139. size
  3140. Set the pen size in points
  3141.  
  3142. ARGUMENTS: 
  3143. size    ± thickness of the pen in points
  3144.  
  3145. DESCRIPTION: 
  3146. Use $b$pensize$b$ to set the thickness of the pen.  Asymptote measures pen sizes in points 
  3147. (72 points = 1 inch).  To draw hairlines on a LaserWriter, use a pensize of 0.25.  
  3148. To 'turn off' the pen, set the pensize to 0.  This is useful if you want to draw filled 
  3149. polygons or points which arenàt outlined by the pen.
  3150.  
  3151. SEE ALSO:
  3152. $b$pencolor$b$  $b$pensize$b$  $b$pendash$b$  $b$penmode$b$  $b$penpattern$b$
  3153.  
  3154. EXAMPLES:
  3155. pensize 3            % draw with a pen thickness of 3
  3156. pensize 1             % normal pen thickness (1 point)
  3157. pensize .25          % hairline on a LaserWriter
  3158.  
  3159. pensize 0           % hide the pen so it's not visible
  3160. fillpattern gray
  3161. plothistogram        % draw a histogram with the pen turned off
  3162. pensize 1          % restore the pen
  3163. $$plotarrows
  3164.  
  3165. Connect pairs of points with arrows or line segments
  3166.  
  3167. ARGUMENTS: 
  3168. none
  3169.  
  3170. DESCRIPTION: 
  3171. Use $b$plotarrows$b$ to plot arrows connecting pairs of points.  To plot line segments 
  3172. (rather than arrows between the points) set $b$scale$b$ to 0.0 (with a scale factor of 0.0 
  3173. Asymptote doesnàt draw arrow heads).
  3174.  
  3175. To use $b$plotarrows$b$ first read the data and store the pairs of points on the calculator 
  3176. stack.  For example, assume your data file has the ($i$x$i$, $i$y$i$) coordinates of the pairs of 
  3177. points arranged in 4 columns (columns 1 and 2 are $i$x$i$ and $i$y$i$ for the start of each line 
  3178. segment, and columns 3 and 4 are $i$x$i$ and $i$y$i$ for the end).  To read these pairs of points and 
  3179. connect them with line segments use:
  3180.  
  3181. readcolumn x 1    % read the starting (x,y) positions of the line segments
  3182. readcolumn y 2
  3183. rpn <y <x        % push the first pair of (x,y) points on the calculator stack
  3184. readcolumn x 3    % Now read the end points of the lines:
  3185. readcolumn y 4
  3186. rpn <y <x        % push the (x,y) end points:
  3187. plotarrows        % draw lines that connect the pairs of points on the stack
  3188.  
  3189. ¥ Note:  If you perform other calculations on the stack, use File>Options>Memory˚Use to 
  3190. configure the calculator to hold more than four vectors.  If you donàt, your calculations 
  3191. may roll off the top of the stack and get lost.
  3192.  
  3193. Remember to set $b$cliptoframe$b$ to $i$true$i$ if you donàt want Asymptote to plot any pairs of 
  3194. points that extend outside the graph frame.
  3195.  
  3196. SEE ALSO:
  3197. $i$Memory Use$i$  $i$Options Menu$i$  $i$File Menu$i$
  3198. $b$readcolumn$b$   $b$readrow$b$
  3199. $b$pendash$b$  $b$penmode$b$  $b$pensize$b$
  3200. $b$pencolor$b$  $b$penpattern$b$
  3201. $b$plotline$b$  $b$plotpoints$b$  $b$plothistogram$b$  $b$ploterrors$b$ 
  3202. $b$cliptoframe$b$ 
  3203. $$ploterrors
  3204. direction
  3205. Use the e vector to draw error bars or arrows at each point 
  3206.  
  3207. ARGUMENTS: 
  3208. direction    ± the direction of the error bar or limit
  3209.         bottom        (=1)
  3210.         left        (=2)
  3211.         top        (=3)
  3212.         right        (=4)
  3213.  
  3214. DESCRIPTION: 
  3215. Use $b$ploterrors$b$ to draw error bars or limit arrows on your graph.  First, read the 
  3216. length of the error bars into the $i$e$i$ vector or use $b$rpn$b$ to calculate the $i$e$i$ vector.  
  3217. Then, use $b$ploterrors$b$ to draw the error bar in the direction you want.  To 
  3218. draw an arrow (to indicate a limit) rather than an error bar at a point, put a negative 
  3219. value in the $i$e$i$ vector for that point.  Use $b$scale$b$ to adjust the size of the crosses or arrow 
  3220. heads on the end of the error bars.  Set $b$scale$b$ to 0 if you don't want crosses or arrow 
  3221. heads.
  3222.  
  3223. You can use $b$ploterrors$b$ repeatedly to draw error bars in all four directions from each 
  3224. point.  Because you can read a different set of error bar data each time you use 
  3225. $b$ploterrors$b$, you can draw error bars with different lengths or limits in each of the 
  3226. four directions.  This makes it possible to draw correct error bars on log-log or 
  3227. semi-log graphs.
  3228.  
  3229. Remember to set $b$cliptoframe$b$ to $i$true$i$ if you donàt want your error bars to extend 
  3230. outside the graph frame.
  3231.  
  3232. SEE ALSO:
  3233. $b$scale$b$
  3234. $b$readcolumn$b$  $b$readrow$b$
  3235. $b$plotline$b$  $b$plotpoints$b$  $b$plothistogram$b$  $b$plotarrows$b$ 
  3236. $b$cliptoframe$b$  
  3237.  
  3238. EXAMPLES:
  3239. readcol x 1        % read the x and y data
  3240. readcol y 2        
  3241. graphlimits
  3242. plotline
  3243. readcolumn e 3    % read the error in x
  3244. ploterrors right    % plot the +x error bars
  3245. ploterrors left    % plot the -x error bars (same as +x)
  3246. readcolumn e 4    % read positive y error
  3247. ploterrors top        % plot the +y direction error bars
  3248. readcolumn e 5    % read negative y error
  3249. ploterrors bottom    % plot the -y direction errors (different than +y)
  3250.  
  3251. ploterrors ?        % Choose the direction graphically
  3252. $$plothistogram
  3253. [ level ]
  3254. Draw the (x, y) points as a histogram
  3255.  
  3256. ARGUMENTS: 
  3257. level    ± the baseline level of the histogram
  3258.  
  3259. DESCRIPTION: 
  3260. Use $b$plothistogram$b$ to draw the data in the $i$x$i$ and $i$y$i$ vectors as a histogram.  If you 
  3261. need to calculate the histogram of your data first, use $b$binxy$b$ then issue the 
  3262. $b$plothistogram$b$ command.  If your $i$x$i$ and $i$y$i$ data are not in order, you can use 
  3263. $b$sort$b$ before plotting the histogram.
  3264.  
  3265. The optional argument to $b$plothistogram$b$ is the baseline level.  If you specify the 
  3266. baseline, $b$plothistogram$b$ fills the area between the baseline level and the histogram 
  3267. using the current $b$fillpattern$b$ and $b$pencolor$b$.  If you don't supply the baseline 
  3268. level, $b$plothistogram$b$ just draws the histogram and doesn't fill the area underneath.
  3269.  
  3270. Remember to set $b$cliptoframe$b$ to $i$true$i$ if you donàt want Asymptote to draw parts of the 
  3271. histogram that may extend outside the graph frame.
  3272.  
  3273. SEE ALSO:
  3274. $b$binxy$b$  $b$sort$b$
  3275. $b$fillpattern$b$  $b$pencolor$b$
  3276. $b$plotline$b$  $b$plotpoints$b$  $b$ploterrors$b$  $b$plotarrows$b$ 
  3277. $b$cliptoframe$b$ 
  3278.  
  3279. EXAMPLES:
  3280. readcol x 3        % read the data
  3281. binxy 100        % calculate a histogram of 100 bins
  3282. graphlimits        % scale the graphlimits to fit it all in
  3283. plothistogram        % plot it without filling underneath
  3284. drawframe
  3285.  
  3286. plothistogram 0.0    %  fill underneath the histogram with the current fill
  3287.              %      pattern and color with a baseline of y= 0.0
  3288. $$plotlabels
  3289. [ position ]
  3290. Plot the labels in the label vector at each point
  3291.  
  3292. ARGUMENTS: 
  3293. position  ± the position of the labels relative to each point:
  3294.         aboveleft  (=7)    above  (=8)     aboveright  (=9)
  3295.         centerleft (=4)     center (=5)      centerright (=6)
  3296.         belowleft  (=1)    below  (=2)     belowright  (=3)
  3297.  
  3298. DESCRIPTION:
  3299. To plot labels at each ($i$x$i$, $i$y$i$) point, first read the labels into the  $i$l$i$ vector with the 
  3300. $b$readcolumn$b$ or $b$readrow$b$ commands.  Then, use $b$plotlabels$b$ and specify how you 
  3301. want Asymptote to position the labels relative to each point.  You can use $b$fontname$b$ and 
  3302. $b$scale$b$ to choose the font and size of the labels and $b$rotation$b$ to rotate them about each 
  3303. point.
  3304.  
  3305. Remember to set $b$cliptoframe$b$ to $i$true$i$ if you donàt want Asymptote to plot labels that 
  3306. lie outside the graph frame.
  3307.  
  3308. SEE ALSO:
  3309. $i$Variables and Constants$i$
  3310. $b$readcolumn$b$  $b$readrow$b$
  3311. $b$fontname$b$  $b$scale$b$   $b$rotation$b$
  3312. $b$plotline$b$  $b$plotpoints$b$  $b$plothistogram$b$  $b$ploterrors$b$  
  3313. $b$plotarrows$b$ 
  3314. $b$cliptoframe$b$ 
  3315.  
  3316. EXAMPLES:
  3317. readrow x 2        % read x, y and the labels from rows 2,3,4 of the data file
  3318. readrow y 3
  3319. readrow l 4
  3320. fontname helvetica
  3321. graphlimits
  3322. plotlabels aboveleft    % draw the labels
  3323. plotpoints        % draw the points
  3324. drawframe        % add a fame
  3325.  
  3326. plotlabels ?
  3327. $$plotline
  3328.  
  3329. Plot a line by connecting the (x, y) data points
  3330.  
  3331. ARGUMENTS: 
  3332. none
  3333.  
  3334. DESCRIPTION: 
  3335. Use $b$plotline$b$ to connect your ($i$x$i$, $i$y$i$) points with a line.  Like all other plotting 
  3336. commands, $b$plotline$b$ uses the current pen properties to draw the line.  If your $i$x$i$ data 
  3337. are in a random order, you may want to use $b$sort$b$ in order to plot a line that moves from 
  3338. left to right or right to left in $i$x$i$.
  3339.  
  3340. Remember to set $b$cliptoframe$b$ to $i$true$i$ if you donàt want Asymptote to plot segments of
  3341. the line that extend outside the graph frame.
  3342.  
  3343. SEE ALSO:
  3344. $i$graphics environment$i$
  3345. $b$plotpoints$b$ $b$ploterrors$b$ $b$plothistogram$b$ $b$plotpolygon$b$ 
  3346. $b$plotlabels$b$ 
  3347. $b$pendash$b$  $b$penmode$b$  $b$pensize$b$
  3348. $b$pencolor$b$  $b$penpattern$b$
  3349. $b$sort$b$
  3350. $b$cliptoframe$b$ 
  3351.  
  3352. EXAMPLES:
  3353. readcolumn x 2    % x data are in column 2
  3354. readcolumn y 3    % y data are in column 3
  3355. graphlimits        % automatic limits
  3356. plotline
  3357. drawframe
  3358. $$plotpoints
  3359.  
  3360. Draw points at all (x, y) points
  3361.  
  3362. ARGUMENTS: 
  3363. none 
  3364.  
  3365. DESCRIPTION: 
  3366. Use $b$plotpoints$b$ to plot a symbol at each ($i$x$i$, $i$y$i$) point.  You can make the symbols 
  3367. larger or smaller with the $b$scale$b$ command, and you can rotate them with the 
  3368. $b$rotation$b$ command.  Asymptote uses the current pen properties such as $b$pensize$b$, 
  3369. $b$pencolor$b$ and $b$penpattern$b$ when drawing the point symbols.  The current $b$fillpattern$b$, 
  3370. if any, is the fill pattern Asymptote uses for filled points.
  3371.  
  3372. To plot the same symbol at each point, use $b$pointsymbol$b$ to specify the symbol you 
  3373. want to plot.  Alternatively you can plot different symbols at each point using 
  3374. information in your data file.  To do this, see the description of how to read point 
  3375. symbols with $b$readcolumn$b$ or $b$readrow$b$.
  3376.  
  3377. Remember that $b$cliptoframe$b$ must be set to $i$true$i$ if you donàt want Asymptote to plot 
  3378. any points that lie outside the graph frame.
  3379.  
  3380. SEE ALSO:
  3381. $b$readcolumn$b$   $b$readrow$b$
  3382. $b$pointsymbol$b$  $b$scale$b$  $b$rotation$b$
  3383. $b$pendash$b$  $b$penmode$b$  $b$pensize$b$
  3384. $b$pencolor$b$  $b$penpattern$b$  $b$fillpattern$b$
  3385. $b$plotline$b$  $b$plotpoints$b$  $b$plothistogram$b$  $b$ploterrors$b$  
  3386. $b$plotarrows$b$ 
  3387. $b$cliptoframe$b$ 
  3388.  
  3389. EXAMPLES:
  3390. readcolumn x 1    % x data are in column 1
  3391. readcolumn y 4    % y data are in column 2
  3392. graphlimits        % automatic limits
  3393. plotpoints
  3394. $$plotpolygon
  3395. [ Closed [ Baseline ]]
  3396. Connect the (x, y) points to form a polygon
  3397.  
  3398. ARGUMENTS: 
  3399. Closed        ± if true, connect the end points of the polygon
  3400. Baseline     ± if specified, connect the end points to this baseline
  3401.  
  3402. DESCRIPTION: 
  3403. Use $b$plotpolygon$b$ to connect the ($i$x$i$, $i$y$i$) points to form a polygon.  Asymptote uses the 
  3404. current fillpattern and pen characteristics to draw and fill the polygon.  The two optional 
  3405. arguments to $b$plotpolygon$b$ allow you to close the polygon by connecting its end points.  
  3406. If you specify $i$true$i$ for the first argument, $b$plotpolygon$b$ connects the end points of the
  3407. curve.  If you also supply the second argument, the baseline level, Asymptote connects 
  3408. the end points of the polygon to the baseline.  This option is useful when you want to 
  3409. fill under a curve with a pattern.  For example, setting the baseline to 0.0 shades the 
  3410. integral under a curve.
  3411.  
  3412. Remember to set $b$cliptoframe$b$ to $i$true$i$ if you donàt want Asymptote to plot any part of 
  3413. the polygon that extends outside the graph frame.
  3414.  
  3415. SEE ALSO:
  3416. $b$pencolor$b$  $b$penpattern$b$  $b$fillpattern$b$
  3417. $b$pendash$b$  $b$penmode$b$  $b$pensize$b$
  3418. $b$readcolumn$b$   $b$readrow$b$
  3419. $b$plotline$b$  $b$plotpoints$b$  $b$plothistogram$b$  $b$ploterrors$b$  
  3420. $b$plotarrows$b$ 
  3421. $b$cliptoframe$b$ 
  3422.  
  3423. EXAMPLES:
  3424. readcolumn x 1    % x data are in column 1
  3425. readcolumn y 2    % y data are in column 2
  3426. graphlimits        % automatic limits
  3427. fillpattern  black
  3428. pencolor blue
  3429. plotpoly
  3430. plotpoly        % connect the x, y points to form a polygon
  3431.  
  3432. plotpolygon closed    % connect the end points to each other
  3433.  
  3434. penpattern none    % turn off the pen
  3435. fillpattern gray    % set to fill with gray
  3436. plotpoly closed 0.0    % fill under (or up to) y= 0.0 with gray
  3437. penpattern black    % turn the pen back on
  3438. pensize 4        % make it thick
  3439. plotpoly open        % draw a thick black line for the actual data
  3440. $$pointsize
  3441. points
  3442. Set the point symbol to use when drawing points
  3443.  
  3444. ARGUMENTS: 
  3445. points        ± point size when scale = 1.0 (in points)
  3446.  
  3447. Use $b$pointsize$b$ to set the size (in points) that you want Asymptote to use for points 
  3448. when the scale factor is set to 1.0.  The $b$pointsize$b$ command is a handy way to adjust 
  3449. the size of your point symbols without having to change $b$scale$b$ every time you draw 
  3450. points.  The default point size is 6 points.  You may want to add the  $b$pointsize$b$ 
  3451. command to your Start Up script if you want to change this default.
  3452.  
  3453. SEE ALSO:
  3454. $i$graphics environment$i$
  3455. $b$pointsymbol$b$ $b$plotpoints$b$ 
  3456.  
  3457. EXAMPLES:
  3458. pointsize 6    % set the point size to 6 points
  3459. scale 1
  3460. plotpoints    % draw points that are 6 points in diameter
  3461. scale 2
  3462. plotpoints    % draw 12 pt points
  3463. $$pointsymbol
  3464. nsides style
  3465. Set the point symbol to use when drawing points
  3466.  
  3467. ARGUMENTS: 
  3468. nsides        ± the number of sides for polygon
  3469. style        ± the style 
  3470.             open        (=0)
  3471.             cross        (=1)
  3472.             star        (=2)
  3473.             filled        (=3)
  3474.  
  3475. DESCRIPTION: 
  3476. Use $b$pointsymbol$b$ to choose which symbol Asymptote uses to plot points on your 
  3477. graph.  To plot the same symbol at each point, first use $b$pointsymbol$b$ to specify the 
  3478. point symbol you want, and then use $b$plotpoints$b$ to plot the points.  Point symbols 
  3479. in Asymptote are drawn as regular polygons that are either open (connect the vertices of 
  3480. the polygon), or filled (same as open but fill the polygon with the current fill pattern), 
  3481. drawn as a cross (connect the vertices to the center of the point), or drawn as a star 
  3482. (connect the vertices to a mid-point).
  3483.  
  3484. To draw different symbols at each point, use the $b$readcolumn$b$ or $b$readrow$b$ 
  3485. commands to read the point symbols from a file, or use $b$rpn$b$ to calculate the symbol 
  3486. to use at each point.  See the description of the $b$readrow$b$ and $b$readcolumn$b$ 
  3487. commands for more information about how to read point symbols from a file.
  3488.  
  3489. You can shrink or enlarge the points with the $b$scale$b$ command or you can change the 
  3490. default point size with $b$pointsize$b$.  Change the color of points with $b$pencolor$b$ and 
  3491. their fill patterns with $b$fillpattern$b$.  You can also rotate points with $b$rotation$b$ 
  3492. (to draw, for example, diamonds rather than squares).
  3493.  
  3494. SEE ALSO:
  3495. $i$graphics environment$i$
  3496. $b$pencolor$b$ $b$pensize$b$ $b$penpattern$b$ $b$penmode$b$
  3497. $b$fillpattern$b$  $b$scale$b$  $b$rotation$b$ $b$pointsize$b$
  3498. $b$readcolumn$b$ $b$readrow$b$
  3499.  
  3500. EXAMPLES:
  3501. pointsymbol 4 filled        % set the point symbol to filled squares
  3502. fillpattern gray
  3503. pencolor red
  3504. plotpoints
  3505.  
  3506. readcolumn x 1        % read x data from column 1
  3507. readcolumn y 2        % read first set of y data from column 2
  3508. pointsymbol 3 filled        % choose filled triangles
  3509. plotpoints            % plot the points
  3510. readcolumn y 3        % read the second set of y data from column 3
  3511. rotation 180            % set the rotation angle to 180 degrees
  3512. plotpoints            % draw the second set of points with upside down triangles
  3513. $$print
  3514.  
  3515. Print the current graph
  3516.  
  3517. ARGUMENTS: 
  3518. none
  3519.  
  3520. DESCRIPTION: 
  3521. Issue the $b$print$b$ command to print your graph on the printer selected in the Chooser.  
  3522. The Chooser is located in the $i$Apple$i$ menu.
  3523.  
  3524. You can put the $b$print$b$ command in a script to generate plots and print them 
  3525. automatically.  This feature even works in the background under MultiFinder or 
  3526. System 7 so you can send your graphs to the printer while you do other work.  To 
  3527. fully automate your printing, you can also save the page setup in your script.  Your 
  3528. script can then specify the page setup with the $b$pagesetup$b$ command.  See the 
  3529. description of $b$pagesetup$b$ for more information.
  3530.  
  3531. SEE ALSO:
  3532. $b$pagesetup$b$
  3533. $b$run$b$
  3534.  
  3535. EXAMPLES:
  3536. pagesetup ?           % Ask for the pagesetup
  3537. readcolumn x 1      % Read the data...
  3538. readcolumn y 2
  3539. graphlimits
  3540. drawframe
  3541. plotline        % ... and plot a line
  3542. print            % Print the graph
  3543.  
  3544. pagesetup        % Read a previously saved page setup from this script
  3545. readcol x 1
  3546. readcol y 2
  3547. graphlimits
  3548. drawframe
  3549. plotpoints
  3550. print            % Print the graph
  3551. $$publish
  3552.  
  3553. Publish the current graph
  3554.  
  3555. ARGUMENTS: 
  3556. none
  3557.  
  3558. DESCRIPTION: 
  3559. Use $b$publish$b$ to publish the current contents of the $i$Graph Window$i$ in a PICT format 
  3560. edition file.  If you havenàt saved the $i$Graph Window$i$ to a publication, Asymptote displays 
  3561. the Edit>Create˚Publisher dialog box where you can name the new publication.  If the 
  3562. $i$Graph Window$i$ already is a publisher, the publish command updates the publisher with
  3563. the current contents of the $i$Graph Window$i$.  This has the same effect as selecting 
  3564. Edit>Publisher˚Options and then clicking the Publish Now button.
  3565.  
  3566. For a detailed description Asymptoteàs Publish and Subscribe features, see Appendix E
  3567. of the Asymptote $i$User's Guide$i$.
  3568.  
  3569. SEE ALSO:
  3570. $b$print$b$
  3571.  
  3572. EXAMPLE:
  3573. publish
  3574. $$quit
  3575.  
  3576. Quit Asymptote and return to the Finder
  3577.  
  3578. ARGUMENTS: 
  3579. none
  3580.  
  3581. DESCRIPTION: 
  3582. Use $b$quit$b$ just as you would use File>Quit.  When you quit, Asymptote checks to see if 
  3583. you have saved changes you made to text files.  If you havenàt, Asymptote asks you if you 
  3584. want to save the changes before quitting.
  3585.  
  3586. You can put the $b$quit$b$ command at the end of a script to have Asymptote quit automatically 
  3587. when it reaches the end of the script. 
  3588.  
  3589. EXAMPLE:
  3590. readcolumn x 1
  3591. readcolumn y 2
  3592. graphlimits
  3593. drawframe
  3594. plotline
  3595. print            % send the plot to the printer
  3596. clear            % erase the graph so Asymptote won't ask if you want to save it
  3597. quit            % quit and return to the Finder
  3598. $$readcolumn
  3599. vectorName n
  3600. Read a column of numbers into one of Asymptoteàs vectors 
  3601.  
  3602. ARGUMENTS: 
  3603. vectorName    ± the name of the vector ($i$x$i$, $i$y$i$, $i$e$i$, $i$p$i$, or $i$l$i$) to store the data
  3604. n        ± the column number to read from the data file
  3605.  
  3606. DESCRIPTION: 
  3607. Use $b$readcolumn$b$ to read a column of numbers or labels from your data file into one 
  3608. of Asymptoteàs vectors.  Before you read the data, you must first specify which data file 
  3609. to use with $b$datafile$b$.  If you want, you can use $b$datalines$b$ to specify which lines 
  3610. you want to read.  If the columns of numbers in your data file are not separated by spaces, 
  3611. commas or tabs, you may want to use $b$datacolumns$b$ to specify how to read the $i$y$i$ data.  
  3612. See the description of $b$datacolumns$b$ for more information about this feature.
  3613.  
  3614. READING NUMBERS FROM A DATA FILE:
  3615. To read numbers from your data file into one of Asymptoteàs vectors, simply type the 
  3616. name of the vector and number of the column you want to read following the 
  3617. $b$readcolumn$b$ command.  If you donàt know the number of the column you want, click the
  3618. column and select Data>Read˚Data>From˚Column.  Asymptote displays a dialog box and 
  3619. enters the number of the column you selected.
  3620.  
  3621. READING LABELS FROM A DATA FILE:
  3622. With Asymptote you can read text labels for your points and plot a different label for 
  3623. each point on your graph.  First, read the coordinates of the points with readcolumn x 
  3624. and readcolumn y, then read the point labels with readcolumn l.  If your labels include 
  3625. spaces, commas or tabs, you must enclose them in quotes.  Use two quotes ("") if you 
  3626. need to insert a quote in a label.
  3627.  
  3628. In the following example, a portion of the data file looks like this:
  3629.  
  3630.     1.1    21    Fred            34.3
  3631.     1.2    22    Hi!            343.0    
  3632.     1.3    23    "1,2,3"        343.0    
  3633.     1.4    24    "How are you?"    29.2
  3634.     1.5    25    ""OK,"" he said."    19.2
  3635.  
  3636. As with all Asymptote data files, you don't need to align the columns of the data file as 
  3637. they appear in this example.  Just be sure that each row contains enough entries and 
  3638. that each entry is separated with spaces, a comma or a tab.
  3639.  
  3640. You could read the points and their labels with the following commands:
  3641. readcolumn x 1
  3642. readcolumn y 2
  3643. graphlimits        % show all of the points
  3644. plotpoints        % plot 'em
  3645.  
  3646. % select a font for the labels:
  3647. font Helvetica        
  3648. readcolumn l 3        % read the labels
  3649. plotlabels aboveleft        % plot the labels
  3650.  
  3651. The above example plots the points using the current $b$pointsymbol$b$, and places the 
  3652. labels above and to the left of each point.  It uses $b$fontname$b$ to select the font for the 
  3653. labels before plotting them with $b$plotlabels$b$.  You could insert a $b$scale$b$ command 
  3654. before calling $b$plotlabels$b$ to adjust the size of the labels or a $b$rotation$b$ command 
  3655. to rotate them about each point.
  3656.  
  3657. READING POINT SYMBOLS FROM A DATA FILE:
  3658. You can use $b$readcolumn$b$ to read point symbols from your data file in order to plot a 
  3659. different symbol at each point.
  3660.  
  3661. The number of sides and the style of each point in the $i$p$i$ vector must be combined into a
  3662. single number as follows:
  3663.  
  3664.     Tens and
  3665.     Hundreds digits:     number of sides for the point
  3666.  
  3667.     Ones digit:        point style (open, cross, star, filled)
  3668.  
  3669.     Fractional part:    scale factor
  3670.  
  3671.     Sign:            if negative, rotate by (180/number of sides)¡
  3672.  
  3673. For example, a value of -43.5 in the $i$p$i$ vector produces a filled square, 0.5 times 
  3674. smaller than the current scale factor which is rotated by 45¡.
  3675.  
  3676. If a value in the $i$p$i$ vector for a particular point is zero, Asymptote wonàt plot it.  You 
  3677. can use this feature to select the points to plot based on some information in your data 
  3678. file.  For example, to plot all points which have a value in the $i$e$i$  vector greater than 
  3679. 100, you could use the following commands:
  3680.  
  3681. rpn <e 100 >         % leave 1's and 0's on the stack if e > 100
  3682. rpn <p * >p        % zero all the p vector elements with e < 100
  3683.  
  3684. You can also use $b$rpn$b$ to calculate the point symbols for the $i$p$i$ vector.  For example, 
  3685. suppose your data file contains the following information about some automobiles:
  3686.  
  3687.     Column          Value
  3688.          1        miles per gallon
  3689.          2        weight
  3690.          3        4, 6, or 8 cylinders
  3691.          4        horse power
  3692.  
  3693. To plot miles per gallon $i$vs.$i$ weight, using filled triangles, squares and circles for 4, 6, 
  3694. or 8 cylinders respectively, you could use these commands:
  3695.  
  3696. readcolumn x 1        % read the x values
  3697. readcolumn y 2        % read the y values
  3698. readcolumn p 3        % read the p values (= 4,6 or 8)
  3699. rpn <p 8 = 15 *        % replace all 8's with 15 (for circles)
  3700. rpn <p 6 = 4 * +        % replace all 6's with 4's (for squares)
  3701. rpn <p 4 = 3 * +        % replace all 4's with 3's (for triangles)
  3702. rpn 10 *            % multiply by 10 to put 30,40 or 150 on the stack
  3703. rpn 3 + >p            % make the point filled (33,43,153)
  3704.  
  3705. To plot only the automobiles that have a horse power greater than 100 add the following 
  3706. commands before plotting the points with $b$plotpoints$b$:
  3707.  
  3708. rpn <p            % save the point symbols on the calculator stack
  3709. readcolumn p 4    % read horse power data into the p vector
  3710. rpn <p 100 >        % if horse power > 100, leave 1 on stack, else 0
  3711. rpn * >p        % multiply the previously saved points symbols and 
  3712.             % store the new point symbols in the $i$p$i$ vector
  3713.     
  3714. Note that this example uses the calculator stack to temporarily hold the point symbols in 
  3715. order to read the horse power data in to the $i$p$i$ vector.
  3716.  
  3717. Alternatively you could scale the size of each point based on the horse power of the car 
  3718. with the following commands:
  3719.  
  3720. rpn <p                % save the point symbols on the stack
  3721. readcolumn p 4         % read horse power into p vector
  3722. rpn <p dup max  1 +  /    % divide p vector by 1 + its maximum
  3723. rpn + >p            % add the fractional part to the original p vector
  3724.                 % which was saved on the stack
  3725.  
  3726. Finally, you could rotate all of the points which had a horse power of 120 or greater
  3727. with the following commands:
  3728.  
  3729. rpn <p            % save the point symbols on the stack
  3730. readcolumn p 4     % read horse power into p vector
  3731. rpn <p 120 >        % put 1 on the stack if horse power > 120, else 0
  3732. rpn -2 * 1 +        % now, -1 if horse power >120, 1 if not
  3733. rpn  * >p        % make all horse power >120 p vector values negative
  3734.  
  3735. SEE ALSO:
  3736. $b$readrow$b$
  3737. $b$datafile$b$  $b$datalines$b$  $b$datacolumns$b$  
  3738.  
  3739. EXAMPLE:
  3740. datafile  1990 data        % Open the data file "1990 data"
  3741. datalines 10 100        % use only lines 10 through 100
  3742. readcolumn y 3        % read these values from column 3 of the file into y
  3743. $$readcursor
  3744. [ delay ]
  3745. Use the graph cursor to read values into the x and y vectors
  3746.  
  3747. ARGUMENTS: 
  3748. delay    ± 1/60th of a second to delay between reading points when the
  3749.       mouse button is held down (0 = read a single point with each click)
  3750.  
  3751. DESCRIPTION: 
  3752. With $b$readcursor$b$ you can read points from your graph using the graph cursor and store 
  3753. the values in the $i$x$i$ and $i$y$i$ vectors.  When you issue the $b$readcursor$b$ command, Asymptote 
  3754. activates the graph cursor.  If you specify a delay following the $b$readcursor$b$ command, 
  3755. Asymptote begins reading a stream of values from your graph as soon as you press and 
  3756. hold down the mouse button.  The delay argument controls how many 1/60ths of a second 
  3757. to wait between reading points in the stream.  If you don't specify a delay (or you 
  3758. give 0 for the delay) Asymptote reads only one point with every click of the mouse.
  3759.  
  3760. To stop reading points, hold down the command and period keys or click outside the 
  3761. $i$Graph Window$i$.
  3762.  
  3763. SEE ALSO:
  3764. $b$export$b$
  3765.  
  3766. EXAMPLE:
  3767. showgraph
  3768. readcursor
  3769. plotpoints
  3770. $$readrow
  3771. vectorName n
  3772. Read a row into one of Asymptoteàs vectors
  3773.  
  3774. ARGUMENTS: 
  3775. vectorName    ± the name of the vector ($i$x$i$, $i$y$i$, $i$e$i$, $i$p$i$, or $i$l$i$) to store the data
  3776. n        ± the row number to read from the data file
  3777.  
  3778. DESCRIPTION: 
  3779. Use $b$readrow$b$ to read a row of numbers from your data file into one of Asymptoteàs 
  3780. vectors.  Before you read the data, you must first specify which data file to use with 
  3781. $b$datafile$b$.  If you donàt want to read all of the  values in a row, use $b$datacolumns$b$ 
  3782. to specify which columns you want.
  3783.  
  3784. READING NUMBERS FROM A DATA FILE:
  3785. To read numbers from your data file into one of Asymptoteàs vectors, simply type the 
  3786. name of the vector and number of the row you want to read following the $b$readrow$b$ 
  3787. command.  If you donàt know the number of the row you want, click the row then select 
  3788. Data>Read˚Data>From˚Row.  Asymptote displays a dialog box and enters the number of 
  3789. the row you selected.
  3790.  
  3791. READING LABELS FROM A DATA FILE:
  3792. With Asymptote you can read text labels for your points and plot a different label for 
  3793. each point on your graph.  First, read the coordinates of the points with readrow x 
  3794. and readrow y, then read the point labels with readrow l.  If your labels include spaces, 
  3795. commas or tabs, you must enclose them in quotes.  Use a two quotes ("") if you need to 
  3796. insert a quote in a label.
  3797.  
  3798. For example, assume that your data file looks like this:
  3799.  
  3800. Fred Hi! "1,2,3"  "How are you?"     ""OK,"" he said.""
  3801. 1.1  1.2  1.3            1.4                1.5
  3802. 21    22    23                24                    25
  3803.  
  3804. As with all Asymptote data files, the columns of the file don't need to be aligned as they 
  3805. are in this example.  Just be sure that each row contains the required number of 
  3806. items and that each entry is separated by spaces, a comma or a tab.
  3807.  
  3808. To plot the points and their labels from this data file use the following commands:
  3809.  
  3810.     readrow x 1
  3811.     readrow y 2
  3812.     graphlimits    % show all the points
  3813.     plotpoints
  3814.     font Helvetica
  3815.     readrow l 3
  3816.     plotlabels aboveleft
  3817.  
  3818. This example plots the points using the current $b$pointsymbol$b$, and places the labels 
  3819. above and to the left of each point.  It uses $b$fontname$b$ to select the font for the labels 
  3820. before plotting them with  $b$plotlabels$b$.  You could insert a $b$scale$b$ command before
  3821. using $b$plotlabels$b$ to adjust the size of the labels or a $b$rotation$b$ command to rotate 
  3822. them about each point.
  3823.  
  3824. READING POINT SYMBOLS FROM A DATA FILE:
  3825. You can use $b$readrow$b$ to read point symbols from your data file in order to plot a 
  3826. different symbol at each point.
  3827.  
  3828. The number of sides and the style of each point in the $i$p$i$ vector must be combined 
  3829. into a single number as follows:
  3830.  
  3831.     Tens and Hundreds digits:    number of sides for the point
  3832.  
  3833.     Ones digit:            point style (open, cross, star, filled)
  3834.  
  3835.     Fractional part        scale factor
  3836.  
  3837.     Sign                if negative, rotate by (180/number of sides)¡
  3838.  
  3839. For example, a value of -43.5 in the $i$p$i$ vector produces a filled square, 0.5 times 
  3840. smaller than the current scale factor which is rotated by 45¡.
  3841.  
  3842. If a value in the $i$p$i$ vector for a particular point is zero, Asymptote wonàt plot it.  You 
  3843. can use this to select the points to plot based on some information in your data file.  For 
  3844. example, to plot all points which have a value in the $i$e$i$  vector greater than 100, you 
  3845. could use the following commands:
  3846.  
  3847. rpn <e 100 >         % leave 1's and 0's on the stack
  3848. rpn <p * >p        % zero all the p vector elements with e < 100        
  3849.  
  3850. You can also use $b$rpn$b$ to calculate the point symbols in the $i$p$i$ vector.  For example, 
  3851. suppose your data file contains the following information about some automobiles:
  3852.  
  3853.         Row               Value
  3854.          1        miles per gallon (MPG)
  3855.          2        weight
  3856.          3        4, 6, or 8 cylinders
  3857.          4        horse power
  3858.  
  3859. To plot lot MPG $i$vs.$i$ weight, using filled triangles, squares and circles for 4, 6 or 8 
  3860. cylinders, you could use the following commands:
  3861.  
  3862. readrow x 1        % read the x values
  3863. readrow y 2        % read the y values
  3864. readrow p 3        % read the p values(4,6 or 8)
  3865. rpn <p 8 = 15 *    % replace all 8's with 15 (for circles)    
  3866. rpn <p 6 = 4 * +    % replace all 6's with 4's (for squares)        
  3867. rpn <p 4 = 3 * +    % replace all 4's with 3's (for triangles)        
  3868. rpn 10 *        % now we have 30,40 or 150 on the stack            
  3869. rpn 3 + >p        % add 3 to make them filled (33,43,153)
  3870.             
  3871. To plot only the automobiles that had a horse power greater than 100 add the following 
  3872. commands before plotting the points with $b$plotpoints$b$:
  3873.     
  3874. rpn <p            % save the point symbols on the stack
  3875. readrow p 4        % read horse power data into the p vector
  3876. rpn <p 100 >        % if horse power>100, leave 1 on stack, else 0
  3877. rpn * >p        % multiply the previously saved point symbols
  3878.             % and store the new point symbols
  3879.     
  3880. Notice that this example uses the calculator stack to temporarily hold the point symbols 
  3881. in order to read the horse power data in to the $i$p$i$ vector.
  3882.  
  3883. Alternatively, you could scale the size of each point based on the horse power of the car 
  3884. with the following commands:
  3885.  
  3886. rpn <p                % save the point symbols on the stack
  3887. readrow p 4             % read horse power into p vector
  3888. rpn <p dup max  1 +  /    % divide p vector by 1 + its maximum
  3889. rpn + >p            % add the fractional part to the original
  3890.                 % $i$p$i$ vector which was saved on the stack
  3891.  
  3892. Finally, you could rotate all of the points which had a horse power of 120 or greater 
  3893. with the commands:
  3894.  
  3895. rpn <p            % save the point symbols on the stack
  3896. readrow p 4         % read horse power into p vector
  3897. rpn <p 120 >        % put 1 on the stack if horse power>120,else 0
  3898. rpn -2 * 1 +         % now, -1 if horse power >120, 1 if not
  3899. rpn  * >p        % make the p vector values negative if horse power > 120        
  3900.  
  3901. SEE ALSO:
  3902. $b$readcolumn$b$  
  3903. $b$datafile$b$  $b$datalines$b$  $b$datacolumns$b$
  3904.  
  3905. EXAMPLE:
  3906. datafile  1990 data        % Open the data file "1990 data"
  3907. datacolumns 2 11        % skip the first item and read the next 10 items
  3908. readrow x 3            % read these values from column 3 of the file into x
  3909. $$repeat
  3910. expression times command
  3911. Repeat a command (or run a script) several times
  3912.  
  3913. ARGUMENTS: 
  3914. expression    ± an expression for the number of times to repeat the command or script
  3915. command     ± the command or script to repeat
  3916.  
  3917. DESCRIPTION: 
  3918. Use $b$repeat$b$ to execute a script or a command a specified number of times.  Following 
  3919. the $b$repeat$b$ command you must provide an expression that evaluates to a single number.
  3920. This expression is the number of times to repeat the command or script.  After the 
  3921. expression, type the word 'times' followed by the command or script you want to run.
  3922.  
  3923. SEE ALSO:
  3924. $b$while$b$
  3925. $b$if$b$
  3926.  
  3927. EXAMPLES:
  3928. repeat 5 times myscript        % execute the script ¾myscriptà 5 times
  3929.  
  3930. set nloops npts 2 /            % nloops = half the number of points
  3931. repeat nloops scaledata 2 3 npts    % run the script 'scaledata'  nloops times
  3932.                     % with 2, 3 and npts as arguments to 'scaledata'
  3933. repeat npts 2 / scaledata 2 3 npts    % Same as the above
  3934.  
  3935. rpn 1                    % put the constant vector 1 on the stack
  3936. repeat 5 times rpn 2 *        % calculate the powers of 2 from 1 to 5
  3937.  
  3938. repeat npts 1 - times myscript    % repeat 'myscript' npts - 1 times
  3939. $$return
  3940.  
  3941. Stop the current script and return to the script that ran the current script 
  3942.  
  3943. ARGUMENTS:
  3944. none
  3945.  
  3946. DESCRIPTION:
  3947. Use $b$return$b$ in a script when you want to stop executing the current script and return 
  3948. to the script that ran the current script (if any).   For example, you might return from 
  3949. a script if a certain condition is met as in the following example:
  3950.     set NumLeftToDo NumLeftToDo 1 -
  3951.     if NumLeftToDo 0 <= then return
  3952. In this example, Asymptote returns from the script if the variable NumLeftToDo is 0 or 
  3953. less.  When this happens, the commands following the $b$if$b$ test are not run.
  3954.  
  3955. Note: The $b$return$b$ command can only be executed from a script.  You can't execute 
  3956. $b$return$b$ from the $i$Command Window$i$.
  3957.  
  3958. SEE ALSO:
  3959. $b$stop$b$ $b$pause$b$  $b$quit$b$  
  3960.  
  3961. EXAMPLES:
  3962. ask Continue Yes No ?Do you want to process another data set?
  3963. if Continue false = then return
  3964.  
  3965. if beta 34 * < alpha then return else calculate_next_alpha
  3966. $$rotation
  3967. degrees
  3968. Set the rotation angle for labels and points
  3969.  
  3970. ARGUMENTS: 
  3971. degrees    ± the angle in degrees, counter clock wise from x axis
  3972.  
  3973. DESCRIPTION: 
  3974. Use $b$rotation$b$ to specify how Asymptote should rotate labels and points.  The rotation 
  3975. angle you supply is measured in degrees, counter-clockwise from the $i$x$i$ (horizontal) 
  3976. axis.  A rotation angle of 0¡ points to the right.  A rotation of 90¡ points up the page.
  3977.  
  3978. SEE ALSO:
  3979. $b$drawlabel$b$
  3980. $b$plotlabels$b$
  3981. $b$plotpoints$b$ $b$pointsymbol$b$
  3982.  
  3983. EXAMPLES:
  3984. readcolumn x 1
  3985. readcolumn y 2        % read the first set of y points
  3986. pointsymbol 3 filled        % filled triangles for points
  3987. plotpoints
  3988. readcolumn y 3        % read some other data
  3989. rotation 180
  3990. plotpoints            % draw the triangles upside down
  3991.  
  3992. graphlimits 0 1 0 1
  3993. moveto .5 .5
  3994. rotation 45
  3995. drawlabel right This is a rotated label
  3996. $$rpn
  3997. expression
  3998. Use the vector calculator to calculate a reverse polish notation (RPN) expression
  3999.  
  4000. ARGUMENTS: 
  4001. expression    ± a RPN expression (see below)
  4002.  
  4003. DESCRIPTION: 
  4004. Use $b$rpn$b$ to access Asymptote's powerful vector calculator.  You might use $b$rpn$b$ to 
  4005. calculate a formula, to manipulate the data before plotting, or to calculate point symbols 
  4006. for use by the $b$plotpoints$b$ command.
  4007.  
  4008. If you are not familiar with reverse polish notation, read Appendix D.  The easiest way to 
  4009. write an $b$rpn$b$ expression is to use the $i$Calculator˚Window$i$.  As you perform calculations 
  4010. in the $i$Calculator Window$i$, Asymptote writes the appropriate $b$rpn$b$ expressions for you.  
  4011. You can use the $i$Vectors˚Window$i$ to examine the calculator stack and the values in 
  4012. Asymptote's vectors.
  4013.  
  4014. To enter a constant in an expression, simply type its value and press the Enter key.  
  4015. Asymptote $i$pushes$i$ the value on the bottom of the calculator stack.  The other vectors 
  4016. on the stack are pushed up.  When $b$rpn$b$ encounters a binary operator (operators such 
  4017. as +,-,/,*), it $i$pops$i$ two values off the bottom of the stack, performs a calculation and 
  4018. pushes the result on the bottom of the stack.  For unary operators (for example rms, 
  4019. sqrt or sin), $b$rpn$b$ replaces the bottom vector of the stack with the results of the 
  4020. calculation.
  4021.  
  4022. The calculator stack has a depth of at least 4 (that means it can remember the last 4 
  4023. vectors you pushed).  You can use File>Options>Memory˚Use to add more vectors to the 
  4024. calculator stack or allocate more registers to use in your calculations.  The following 
  4025. table lists all of the $b$rpn$b$ operators and functions:
  4026.  
  4027.         $b$RPN CALCULATOR OPERATORS$b$
  4028. stack x =  bottom vector on the stack (not the x vector)
  4029. stack y =  2nd to the bottom vector on the stack (not the y vector)
  4030.  
  4031. In the $i$Vectors Window$i$ the vectors on the stack are numbered 0 through 3.  The vector 
  4032. labeled ¾Stack 0à is stack x, the vector labeled ¾Stack 1à is the same as  y).
  4033.  
  4034. ___   $i$Store/Recall Operators$i$   _____________________________________________
  4035. The following operators push an Asymptote vector onto the bottom of the stack:
  4036. <x        push the $i$x$i$ vector onto the bottom of the stack (stack x)
  4037. <y        push the $i$y$i$ vector onto the bottom of the stack (stack x)
  4038. <p        push the $i$p$i$ vector onto the bottom of the stack (stack x)
  4039. <e        push the $i$e$i$ vector onto the bottom of the stack (stack x)
  4040. <rn        push the register n onto the bottom of the stack (stack x)
  4041.     
  4042. The following commands copy stack $i$x$i$ into one of Asymptoteàs vectors.  They do not alter 
  4043. the calculator stack:
  4044. >x        store stack $i$x$i$ in the $i$x$i$ vector
  4045. >y        store stack $i$x$i$ in the $i$y$i$ vector 
  4046. >p        store stack $i$x$i$ in the $i$p$i$ vector
  4047. >e        store stack $i$x$i$ in the $i$e$i$ vector 
  4048. >rn        store stack $i$x$i$ in register n
  4049.  
  4050. ___   $i$Stack Operators$i$   __________________________________________________
  4051. The following operators manipulate the stack:
  4052. dup        duplicate stack $i$x$i$
  4053. drop        pop stack $i$x$i$ off the stack and drop the stack down
  4054. xy        swap stack $i$x$i$ and stack $i$y$i$
  4055. cx        clear stack $i$x$i$ (replace stack $i$x$i$ with zeros) 
  4056. rad        switch to radians for subsequent calculations
  4057. deg        switch to degrees for subsequent calculations
  4058.  
  4059. ___   $i$Logical Operators$i$   _______________________________________________________
  4060. The following operators pop two vectors off the stack, compare them with a logical test, 
  4061. and push the results of the test with a vector of 1às and 0às (true or false).
  4062. =        push 1 if x = y, else 0
  4063. <> or ›        push 1 if x › y, else 0
  4064. <        push 1 if x < y, else 0
  4065. >        push 1 if x > y, else 0
  4066. <=        push 1 if x <= y, else 0
  4067. >=        push 1 if x >= y, else 0
  4068.  
  4069. ___   $i$Unary Operators$i$   _____________________________________________________________
  4070. The following operators pop stack x, calculate something with it, and push the result on 
  4071. the stack:
  4072. !        replace stack $i$x$i$ with its factorial
  4073. chs        replace stack $i$x$i$ with -$i$x$i$
  4074. int        replace stack $i$x$i$ with integer portion of $i$x$i$
  4075. frac        replace stack $i$x$i$ with fractional portion of $i$x$i$
  4076. abs        replace stack $i$x$i$ with absolute value of $i$x$i$
  4077. sqrt        replace stack $i$x$i$ with square root of $i$x$i$
  4078. sin        replace stack $i$x$i$ with sine of $i$x$i$ (units set by rad/deg)
  4079. cos        replace stack $i$x$i$ with cosine of $i$x$i$ (units set by rad/deg)
  4080. tan        replace stack $i$x$i$ with tangent of $i$x$i$ (units set by rad/deg)
  4081. asin        replace stack $i$x$i$ with arcsine of $i$x$i$ (units set by rad/deg)
  4082. acos        replace stack $i$x$i$ with arccosine of $i$x$i$ (units set by rad/deg)
  4083. atan        replace stack $i$x$i$ with arctan of $i$x$i$ (units set by rad/deg)
  4084. log        replace stack $i$x$i$ with log (base 10) of $i$x$i$
  4085. ln        replace stack $i$x$i$ with log (base e) of $i$x$i$
  4086. 10^x        replace stack $i$x$i$ with 10 raised to the $i$x$i$ power
  4087. e^x        replace stack $i$x$i$ with e raised to the $i$x$i$ power
  4088. hrs        convert hhmmss.s notation to decimal hours
  4089. hms        convert decimal hours to hhmmss.s notation
  4090. index        replace stack $i$x$i$ with 1,2,3,4,5...n
  4091. ran        replace stack $i$x$i$ with a random number (-1,1)
  4092. max        replace stack $i$x$i$ with the maximum of $i$x$i$
  4093. min        replace stack $i$x$i$ with the minimum of $i$x$i$
  4094. mean        replace stack $i$x$i$ with the mean of the $i$x$i$ vector
  4095. sum        replace stack $i$x$i$ with the sum of the $i$x$i$ vector
  4096. rms        replace stack $i$x$i$ with the root mean square of the $i$x$i$ vector
  4097.  
  4098. ___   $i$Binary Operators$i$   _______________________________________________________
  4099. The following operators pop stack $i$x$i$ and stack $i$y$i$ stack, calculate something and push the 
  4100. results of a calculation:
  4101. +        push y + x
  4102. -        push y - x
  4103. /        push y / x
  4104. *        push y * x
  4105. y^x        push y raised to the x power
  4106. ________________________________________________________________________________
  4107.  
  4108. You must separate operators and values in an $b$rpn$b$ expression with spaces.  For 
  4109. example donàt use:
  4110.     rpn <x56 <y*
  4111. use
  4112.     rpn <x 56 + <y *
  4113. instead.
  4114.  
  4115. If you need to calculate something using several different columns of your data file, 
  4116. remember that you can store intermediate results of your calculator on the calculator 
  4117. stack, in registers or any of the $i$x$i$, $i$y$i$, $i$e$i$ and $i$p$i$ vectors.  In this way you can read some 
  4118. data, perform some calculations in $b$rpn$b$ leaving the results on the stack, read some 
  4119. more data and then finish the calculation.  For example, to store the sum of columns 1 
  4120. through 3 of your data file divided by column 7, you could use the following commands:
  4121.  
  4122. readcol x 1
  4123. readcol y 2
  4124. readcol e 3
  4125. rpn <x <y <e + +           % push all three vectors and add together
  4126. readcol e 7            % read some more data into the e vector
  4127. rpn <e /            % divide the sum by the data in the e vector
  4128. rpn >x                 % store the result in the x vector
  4129. $$run
  4130. [ scriptname ]
  4131. Run the Recorder or some other script 
  4132.  
  4133. ARGUMENTS: 
  4134. scriptname    ± the name of the script to run
  4135.  
  4136. DESCRIPTION: 
  4137. Use $b$run$b$ to run script.  If you donàt specify the name of the script, Asymptote runs 
  4138. the Recorder.
  4139.  
  4140. If you specify the script to run, Asymptote searches for it automatically using the 
  4141. current $i$search paths$i$ file.  You might create a directory with your favorite scripts and 
  4142. then add the path to that directory to your Search Paths file.  Then, whenever you type 
  4143. the name of one of your scripts in the $i$Command Window$i$ or in a script, Asymptote opens 
  4144. and runs the script automatically.
  4145.  
  4146. Remember, it is not necessary to use $b$run$b$ to run a script.  Most scripts can be run by 
  4147. simply typing the script name as if it were an Asymptote command.  In other words, the 
  4148. command
  4149.     run MyScript
  4150. is the same as the command
  4151.     MyScript
  4152. When Asymptote encounters a command thatàs not an Asymptote command, it assumes the 
  4153. command is the name of a script.  Asymptote tries to locate a file with that name and run 
  4154. it.  If there are spaces in the script name, however, you canàt type the script name as a 
  4155. command and must use the $b$run$b$ command instead.  For example, you could run the 
  4156. script ¼Plot January Data½ with the command
  4157.     run Plot January Data
  4158. but just typing
  4159.     Plot January Data
  4160. produces an error because Asymptote tries to locate a script named ¼Plot½ and assumes 
  4161. that ¼January½ and ¼Data½ are the arguments to the command ¼Plot.½  Note that you 
  4162. could avoid this problem by naming the file ¼Plot_January_Data½ instead.
  4163.  
  4164. PASSING ARGUMENTS TO SCRIPTS:
  4165. You can pass arguments to a script by specifying the arguments after the script name.  
  4166. Use &n, where n is a number to denote the value of the nth argument.  For example, 
  4167. if the script 'scaledata' contained the following commands:
  4168.     rpn <x &1 * >x
  4169.     rpn <y &2 * >y
  4170. and you typed
  4171.     scaledata 2.3 34.9
  4172. in the $i$Command Window$i$, Asymptote multiplies the $i$x$i$ vector by 2.3 and the $i$y$i$ vector by 
  4173. 34.9.  You can also pass labels as arguments to scripts.  If they include spaces, 
  4174. enclose them in quotes like this:
  4175.     addmylabels "March 12 run" "New atomic constants"
  4176. You can also pass expressions as arguments to scripts if you also include them in quotes 
  4177. as in this example:
  4178.     scaledata "\npts 10 *" 34.9
  4179. The first argument to the script 'scaledata' is the expression "\npts 10 *" (10 times the 
  4180. current number of points) and the value of the second argument is 34.9.  When 
  4181. 'scaledata' runs, it scales the $i$x$i$ data by 10 times the number of points and 
  4182. the $i$y$i$ data by the constant 34.9.
  4183.  
  4184. USING THE SEARCH PATHS FILE TO OPEN YOUR SCRIPT FILE AUTOMATICALLY:
  4185. If Asymptote canàt locate a script for you automatically, make sure you have properly 
  4186. specified a search path to the file in the current paths file and that youàve spelled the 
  4187. name of the file correctly (including spaces).  For help using the Search Paths file, 
  4188. see Appendix B of the $i$User's Guide$i$ or type
  4189.    help Search Paths
  4190. in the $i$Command Window$i$.
  4191.  
  4192. SPECIFYING THE FULL OR PARTIAL PATH NAME OF YOUR FILE:
  4193. Itàs best to let Asymptote locate a file for you automatically by putting a path to the file 
  4194. in your Search Paths file.  If you want to open a specific file in a specific directory, you 
  4195. can specify the full or partial path name of the file when you issue the $b$run$b$ command.  
  4196. Full path names start with a disk name (usually your hard disk name) and are followed 
  4197. by the name of each subfolder separated by colons and end with the name of the file.  For 
  4198. example, to run the script "loaddata" in the folder "March 12" which is on the hard disk 
  4199. named "My Disk" you could use the following command:
  4200.     run My disk:March 12:loaddata
  4201. Alternatively, if the folder "March 12" were in the same folder with Asymptote, you 
  4202. could use the partial path name:
  4203.     run :March 12:loaddata
  4204. to run the script.  Note that partial path names begin with a colon, while full path names 
  4205. do not.  Partial path names always start their search starting with the folder that 
  4206. contains Asymptote.
  4207.  
  4208. SEE ALSO:
  4209. $i$search paths$i$
  4210. $b$pause$b$ $b$stop$b$ $b$quit$b$
  4211.  
  4212. EXAMPLES:
  4213. % The following commands are three different ways to run the same script assuming
  4214. % that the path
  4215. %        HardDisk:New Data:*
  4216. % is in the current search path
  4217. run myscript
  4218. myscript
  4219. HardDisk:New Data:myscript
  4220. $$savegraph
  4221.  
  4222. Save the current graph to a PICT file
  4223.  
  4224. ARGUMENTS: 
  4225. none
  4226.  
  4227. DESCRIPTION:
  4228. The $b$savegraph$b$ command is the same as selecting File>Save Graph.  
  4229.  
  4230. SEE ALSO:
  4231. $b$publish$b$
  4232. $$scale
  4233. factor
  4234. Set the scale factor for labels, points and tickmarks
  4235.  
  4236. ARGUMENTS: 
  4237. factor        ± the scale factor
  4238.  
  4239. DESCRIPTION: 
  4240. The $b$scale$b$ parameter of the $i$graphics environment$i$ controls the sizes of labels, points 
  4241. and the length of tickmarks and error bar caps.  A scale factor of 1.0 draws points, 
  4242. labels and tick marks at their default size.  You can change these defaults using 
  4243. $b$pointsize$b$ $b$fontsize$b$ and $b$ticksize$b$.  If you donàt change the defaults, Asymptote 
  4244. uses 12 points for text and tick marks and 6 points for point symbols.  With these 
  4245. defaults, if you set $b$scale$b$ to 2, Asymptote draws 24 point text and tick marks and 12 
  4246. point symbols.
  4247.  
  4248. SEE ALSO:
  4249. $i$graphics environment$i$
  4250. $b$rotation$b$
  4251. $b$drawframe$b$ $b$drawlabel$b$
  4252. $b$drawxlabel$b$ $b$drawylabel$b$ $b$drawtitle$b$
  4253. $b$plotpoints$b$ $b$drawpoint$b$
  4254. $b$fontsize$b$ $b$ticksize$b$ $b$pointsize$b$
  4255.  
  4256. EXAMPLES:
  4257. scale 2.0
  4258. drawlabel centerleft This label is twice as big
  4259.  
  4260. scale 1
  4261. drawtitle This is a 12˚pt title
  4262.  
  4263. scale 1.2
  4264. moveto .5 .5
  4265. pointsymbol 5 star
  4266. drawpoint
  4267. scale scale 2 *     % make the scale twice as big
  4268. moveto .5 .5
  4269. drawpoint
  4270.  
  4271. readcolumn x 1
  4272. readcolumn y 2
  4273. graphlimits
  4274. scale .75        
  4275. drawframe        % draw a frame with reduced tickmarks
  4276. pointsymbol 4 cross
  4277. scale 1.0        
  4278. plotpoints        % draw normalized points
  4279. readcolumn y 3    % read some more y data
  4280. scale 2.0
  4281. plotpoints        % draw these points twice as big
  4282. $$set
  4283. variablename expression
  4284. Set the value of a variable
  4285.  
  4286. ARGUMENTS: 
  4287. variablename        ± the name of the variable to set
  4288. expression        ± an expression for the value to set
  4289.  
  4290. DESCRIPTION: 
  4291. Use the $b$set$b$ command to alter the value of a variable.  If the variable doesnàt exist, 
  4292. Asymptote creates a new one and sets its initial value.
  4293.  
  4294. If you want to have the script ask the user (a technician, perhaps) to set the value of a 
  4295. user variable while it is running, replace the expression with a question mark followed 
  4296. by a prompt.  The prompt is optional, so if you donàt supply one Asymptote supplies 
  4297. a prompt.  For example, the command
  4298.     set myvar ?What should be the value for myvar?
  4299. displays a dialog box that asks you to specify ¾myvar.à  When Asymptote displays the 
  4300. dialog box, it uses the current value of the variable as the default expression.  Thus, to 
  4301. change the default response simply set the variable first, then use $b$set$b$ again to ask 
  4302. for a new value.  For example, the following commands
  4303.  
  4304. set myvar 28.9
  4305. set myvar ?What should be the value for myvar?
  4306. ask you to set myvar after setting the default response to 28.9.
  4307.  
  4308. If you use $b$set$b$ with a question mark prompt to define a variable that doesnàt exist, 
  4309. Asymptote displays an message asking if you want to create a new variable.  This feature 
  4310. helps you avoid confusion due to misspelled variable names.  To prevent Asymptote from 
  4311. asking if you want to create the variable, simply set the variable to some default value 
  4312. first, and then use the $b$set$b$ command with a question mark.
  4313.  
  4314. SEE ALSO:
  4315. $i$Variables and Constants$i$
  4316. $b$rpn$b$
  4317.  
  4318. EXAMPLES:
  4319. set myvar x(10) 23 +    % set 'myvar' to be x(10) plus 23
  4320.  
  4321. set xyz npts 1 -        % set 'xyzà = current number of points minus 1
  4322.  
  4323. set count count 1 +        % increment 'count' by 1
  4324.  
  4325. set NumToDo 5        % Make 5 the default number of items to do
  4326. set NumToDo ?How many items do you want to process?
  4327. repeat NumToDo times process_another_item
  4328. $$showgraph
  4329.  
  4330. Zoom the $i$Graph Window$i$ to show the graph frame
  4331.  
  4332. ARGUMENTS: 
  4333. none
  4334.  
  4335. DESCRIPTION:
  4336. The $b$showgraph$b$ command is the same as selecting Plot>Show˚Graph.  Asymptote 
  4337. centers the frame in the $i$Graph Window$i$ by scrolling and zooming your graph.  You can 
  4338. use $b$showgraph$b$ in a script to display the graph in the $i$Graph Window$i$.
  4339.  
  4340. SEE ALSO:
  4341. $b$showpage$b$ fullscreen
  4342. $$showpage
  4343.  
  4344. Zoom the $i$Graph Window$i$ to show the entire page
  4345.  
  4346. ARGUMENTS: 
  4347. none
  4348.  
  4349. DESCRIPTION:
  4350. The $b$showpage$b$ command is the same as selecting Plot>Show˚Graph.  Asymptote 
  4351. centers the page in the $i$Graph Window$i$ by scrolling and zooming your graph.  You can use 
  4352. $b$showpage$b$ in a script to display the entire page in the $i$Graph Window$i$.
  4353.  
  4354. SEE ALSO:
  4355. $b$showgraph$b$  fullscreen
  4356. $$showwindow
  4357. [ windowName ]
  4358. Make a window visible
  4359.  
  4360. ARGUMENTS: 
  4361. windowName    ± the name of the window to show
  4362.  
  4363. DESCRIPTION:
  4364. Use $b$showwindow$b$ to make a window visible after it was hidden with $b$hidewindow$b$.  
  4365. If you don't specify a window name, Asymptote makes the current window visible.  You 
  4366. can use the command
  4367.     showwindow \f
  4368. or
  4369.     showwindow \r
  4370. to show the current data file and Recorder windows .
  4371.  
  4372. EXAMPLES:
  4373.  
  4374. showwindow test data        % make the window 'test data' visible
  4375.  
  4376. showwindow \f        % Show the current data file window, whatever its name is
  4377.  
  4378. hidewindow            % hide this window
  4379. ask junk "I, know" "Who cares?" ¼You can't see me!½
  4380. showwindow            % make this window visible again
  4381. $$smooth
  4382. width
  4383. Smooth the y vector with a variable width window
  4384.  
  4385. ARGUMENTS: 
  4386. width        ± the width of the smoothing window
  4387.  
  4388. DESCRIPTION: 
  4389. When you use $b$smooth$b$, Asymptote takes the Fast Fourier Transform (FFT) of the 
  4390. $i$y$i$ vector, smoothes it by a window with the width you specify (roughly the number 
  4391. of points to average), takes the inverse FFT and replaces the $i$y$i$ vector with the 
  4392. smoothed data.  Another way to smooth your data is with the $b$spline$b$ command.
  4393.  
  4394. EXAMPLES:
  4395. readcolumn x 1
  4396. readcolumn y 2
  4397. graphlimits
  4398. plotpoints        % plot the unsmoothed data
  4399. smooth 2.3
  4400. plotline        % plot a smoothed line
  4401. $$sort
  4402.  
  4403. Sort the y, e, p and l vectors by increasing x
  4404.  
  4405. ARGUMENTS: 
  4406. none
  4407.  
  4408. DESCRIPTION: 
  4409. When you issue the $b$sort$b$ command, Asymptote sorts the $i$y$i$, $i$e$i$, $i$p$i$, and $i$l$i$ vectors by 
  4410. ascending value of the $i$x$i$ vector.  The calculator stack and its registers are unchanged.
  4411.  
  4412. You can use $b$sort$b$ to sort the $i$x$i$ and $i$y$i$ points so they can be connected with a line 
  4413. that goes smoothly from left to right.  In addition, some commands, like $b$spline$b$, only 
  4414. work on sorted data so you must use $b$sort$b$ before you can use them.
  4415.  
  4416. EXAMPLES:
  4417. readcolumn x 1
  4418. readcolumn y 2
  4419. sort
  4420. plotline
  4421. $$spline
  4422. [ npts ]
  4423. Calculate the natural cubic spline of y= f(x)
  4424.  
  4425. ARGUMENTS: 
  4426. npts    ± the number of points in the splined curve
  4427.  
  4428. DESCRIPTION: 
  4429. Use $b$spline$b$ to calculate the natural cubic spline of the curve $i$y$i$ = f($i$x$i$).  Asymptote 
  4430. replaces the $i$x$i$ and $i$y$i$ vectors with the calculated spline curve.  You can specify, npts, 
  4431. the number of points in the spline.  If you don't supply npts, $b$spline$b$ uses four times 
  4432. the current number of points for the spline curve.  Asymptote distributes the points 
  4433. evenly from $i$xleft$i$ to $i$xright$i$.
  4434.  
  4435. If the values in the $i$x$i$ vector are not in order, you must sort them first with the $b$sort$b$ 
  4436. command before using $b$sort$b$.
  4437.  
  4438. EXAMPLES:
  4439. readcolumn x 1
  4440. readcolumn y 2
  4441. sort
  4442. graphlimits        % do this to set \xleft and \xright using the x vector data
  4443. plotpoints
  4444. spline 100        % calculate a spline of 100 points
  4445. plotline        % and plot it on top of the points
  4446.  
  4447. graphlimits 10 12.3 0 
  4448. spline 25        % calculate a spline of 25 points running from  x= 10 to 12.3
  4449. $$stop
  4450.  
  4451. Stop running the current script
  4452.  
  4453. ARGUMENTS: 
  4454. none
  4455.  
  4456. DESCRIPTION: 
  4457. Putting $b$stop$b$ in a script stops running the script.  The $b$stop$b$  command is the same as 
  4458. selecting Script>Stop.  But if you want to stop running a script $i$and$i$ quit Asymptote too, 
  4459. use $b$stop$b$.
  4460.  
  4461. SEE ALSO:
  4462. $b$quit$b$
  4463. $b$pause$b$ $b$return$b$ 
  4464.  
  4465. EXAMPLE:
  4466. ask AllDone Yes No Do you want to stop running this script?
  4467. $$textmode
  4468. [ n ]
  4469. Set the transfer mode for drawing text
  4470.  
  4471. ARGUMENTS: 
  4472. n    ± a mode number
  4473.     or
  4474.     ± a mode name(opaque, transparent, reversed)
  4475.  
  4476. DESCRIPTION: 
  4477. Use $b$textmode$b$ to select a text drawing mode.  Some constants have been defined to help 
  4478. you choose a mode, they are $i$opaque$i$, $i$transparent$i$, and $i$reversed$i$.
  4479.  
  4480. To choose a mode graphically type:
  4481.     textmode ?
  4482. to see an illustration.
  4483.  
  4484. Keep in minds that most PostScript printers, including the LaserWriter, do not make 
  4485. use of text transfer modes.  This is a feature of the LaserWriter driver supplied by 
  4486. Apple.  Text modes are visible on QuickDraw based printers, however.
  4487.  
  4488. SEE ALSO:
  4489. $i$Variables and Constants$i$
  4490. $b$fontname$b$  $b$scale$b$
  4491. $b$penmode$b$ $b$pencolor$b$ $b$pensize$b$ $b$pendash$b$ $b$penpattern$b$
  4492.  
  4493. EXAMPLES:
  4494. moveto .5 .5
  4495. fillpattern black
  4496. pencolor black
  4497. pointsymbol 4 filled
  4498. scale 5
  4499. drawpoint        % draw a big black square
  4500. scale 1.0
  4501. moveto .5 .5
  4502. textmode reversed
  4503. drawlabel center This label is reversed
  4504. $$ticksize
  4505. points
  4506. Set the default tick mark size
  4507.  
  4508. ARGUMENTS: 
  4509. points        ± tick mark size when scale = 1.0 (in points)
  4510.  
  4511. DESCRIPTION: 
  4512. Use $b$ticksize$b$ to set the size (in points) that you want Asymptote to use tick marks 
  4513. when the scale factor is set to 1.0.  The $b$ticksize$b$ command is a handy way to adjust 
  4514. the size of tickmarks without having to change $b$scale$b$ every time you draw axes.  
  4515. The default tick mark size is 12 points.  You may want to add the  $b$ticksize$b$ 
  4516. command to your Start Up script if you want to change this default.
  4517.  
  4518. SEE ALSO:
  4519. $i$graphics environment$i$
  4520. $b$drawframe$b$ $b$drawaxis$b$ 
  4521.  
  4522. EXAMPLES:
  4523. ticksize 10    % set the tick size to 10 points
  4524. scale 1
  4525. drawframe    % draw 10 point tickmarks
  4526. scale 2
  4527. plotpoints    % draw 20 pt tick marks
  4528.  
  4529. $$while
  4530. expression do command
  4531. Execute a command or macro while an expression is true 
  4532.  
  4533. ARGUMENTS: 
  4534. expression      ± a logical expression that evaluates to a true (1) or false (0) value
  4535. command       ± a command to execute while the expression remains true
  4536.  
  4537. DESCRIPTION: 
  4538. Use $b$while$b$ to execute a command while a logical test is true.  If the command is the 
  4539. name of a script, Asymptote executes script until the condition is false.  Following the 
  4540. $b$while$b$ command you must supply the expression to evaluate, the word $i$do$i$ and 
  4541. the command you want Asymptote to execute.
  4542.  
  4543. SEE ALSO:
  4544. $b$repeat$b$  $b$if$b$
  4545.  
  4546. EXAMPLES:
  4547. while notfinished do mymacro     % run 'mymacro' until \notfinished is false
  4548.  
  4549. while x(1) 10 > do rpn <x 2 / >x     % keep dividing x by 2 until x(1) is < 100
  4550.  
  4551. $$zoomgraph
  4552. [ factor ]
  4553. Zoom the graph to display it either reduced or enlarged 
  4554.  
  4555. ARGUMENTS: 
  4556. factor    ± the new graph zoom factor (>= 0)
  4557.         > 1    =>     zoom the graph to show it enlarged
  4558.         =1    =>     has no effect (ignored)
  4559.         < 1       =>     zoom the graph to show it reduced
  4560.         = 0       =>     same as clicking on the zoom box of the $i$Graph Window$i$
  4561.  
  4562. DESCRIPTION: 
  4563. Use $b$zoomgraph$b$ to display the graph at a different scale or to zoom the Graph 
  4564. Window to fill the entire screen.  Since $b$zoomgraph$b$ shrinks or expands the graph at 
  4565. the point in the center of the $i$Graph Window$i$, you may want to use 
  4566. $b$showgraph$b$ to center your graph first.  Clicking the center of your graph with the 
  4567. magnify or demagnify cursors is exactly the same as the $b$zoomgraph$b$ command.  
  4568. With $b$zoomgraph$b$, however, you can specify exactly how much you want to expand 
  4569. or contract the graph.  Remember that $b$zoomgraph$b$ does not change the scale of your 
  4570. graph or any of the variables of the $i$graphics environment$i$; it simply changes how the 
  4571. graph is displayed in the $i$Graph Window$i$.
  4572.  
  4573. SEE ALSO:
  4574. $b$showgraph$b$  $b$showpage$b$
  4575. $b$fullscreen$b$
  4576.  
  4577. EXAMPLES:
  4578. showgraph        % center the current graph frame in the $i$Graph Window$i$
  4579. zoomgraph 2.5    % expand the graph to display it at 
  4580.             % 2.5 times the current size
  4581.  
  4582. zoomgraph    % zoom the $i$Graph Window$i$ to fill the screen
  4583. showpage    % show the entire page in the window
  4584. $$Reading data
  4585. Using Asymptote
  4586. Asymptote data files are ordinary 'TEXT' (ASCII) files.  Unlike other Macintosh plotting 
  4587. programs, Asymptote does not 'import' your data into an internal file format that is 
  4588. unreadable by any other program.  You donàt have to ¾importà your data every time your 
  4589. data file has changed.  With Asymptote, you can be sure that what youàre plotting is 
  4590. up-to-date information.
  4591.  
  4592. PUBLISH AND SUBSCRIBE:
  4593. If you are using System 7, you can also use Publish and Subscribe to exchange data 
  4594. between Asymptote and other applications.  With Publish and Subscribe, the changes 
  4595. you make to a document in one application are automatically updated in all other 
  4596. applications that ¾subscribeà to the data.  For more information on how to use 
  4597. Publish and Subscribe with Asymptote, see Appendix˚E of the $i$Users Guide$i$.
  4598.  
  4599. READING DATA:
  4600. To read your data into Asymptote, first specify the file you want to read with the 
  4601. $b$datafile$b$ command.  If you want to skip over a header at the top of your data file, or if 
  4602. you want to read only from certain lines or columns of the data file, issue the 
  4603. $b$datalines$b$ or $b$datacolumns$b$ commands.  Finally, read the data from columns using 
  4604. $b$readcolumn$b$ or from rows using $b$readrow$b$.  These commands store the values or 
  4605. labels you read in one of Asymptote's x, y, e, p or l vectors.  Here is an example:
  4606.  
  4607.     datafile MyDataFile    % Open the file "MyDataFile"
  4608.     datalines 3        % Skip the first two lines which are a header
  4609.     readcolumn x 1    % Read the values in column 1 into the x vector
  4610.     readcolumn y 3    % Read the values in column 3 into the y vector
  4611.     graphlimits        % Find the limits of x and y
  4612.     drawframe        % Draw a frame
  4613.     plotpoints        % Plot the points
  4614.  
  4615. FLEXIBLE FILE FORMAT:
  4616. Asymptote looks for any number of spaces, a tab or a comma to distinguish items in 
  4617. a particular line of your data file.  For example, the lines below have 6 columns each:
  4618.  
  4619. 123  18.9    1E4.4  "Lot A" 0.0000234    99
  4620. 124  19    1E4.5  "Lot A" 0.0000274    99
  4621. 125   8    1E4.6  "Lot B" 0.0000232    99
  4622. 126  23.4    1E4.3  "Lot B" 0.0000172    99
  4623. 127   0    1E4.1  "Lot B" 0.0000984    99
  4624.  
  4625. The columns could be separated by any number of spaces, tabs or a single comma.  It's 
  4626. not necessary for the columns of your data file to be lined up in order to read the data 
  4627. into Asymptote.  If the columns of your file are not separated this way, you can use 
  4628. $b$datacolumns$b$ to specify which characters to read from each line $i$before$i$ you 
  4629. read any data (see $b$datacolumns$b$ for more information).  You can also use Asymptoteàs 
  4630. $i$Search$i$ and $i$Replace$i$ menus to reformat the text as necessary.  To do a fancier search 
  4631. and replace, you can use the $i$GREP$i$ option in the ¼Find½ dialog box.  See Appendix D 
  4632. of the $i$User's Guide$i$ for information on how to use GREP.
  4633.  
  4634. READING LABELS:
  4635. Normally your labels do not need to be enclosed in double quotation marks ("), but if 
  4636. you want to read labels that contain spaces, tabs or commas, you must enclose them 
  4637. in quotation marks.  Use two double quotation marks in a row ("") to denote a quotation 
  4638. marks within a label.
  4639. $$Startup script
  4640. Using Asymptote
  4641. The startup script is a special script Asymptote executes every time it starts up.  You 
  4642. can use the startup script to change the default variables of the $i$graphics environment$i$.
  4643.  
  4644. Make changes to the startup script when you want to reconfigure Asymptote to suit your 
  4645. needs.  The startup script is just like any other script except that Asymptote runs it 
  4646. automatically when it starts up (unless you have turned this preference off).  After 
  4647. the startup script runs, Asymptote records the state of the $i$graphics environment$i$.  
  4648. Later, when you select $i$Run˚Recorder$i$, Asymptote resets the variables of the 
  4649. $i$graphics environment$i$ to the values it had when the startup script finished running.  
  4650. In this way you can use the startup script to change the default values of various 
  4651. variables such as the font, graph frame, or pen size.
  4652.  
  4653. In order for Asymptote to find the startup script, it must be named ¾Asymptote Startupà 
  4654. and it must be in the same folder with Asymptote.  If you donàt have a startup script, 
  4655. you can create a new one by selecting File New to open a Text Editor Window.  If you 
  4656. create a new startup script, be sure to name it ¾Asymptote Startupà and save it in the 
  4657. same folder as Asymptote.  You can modify the startup script and make changes to it 
  4658. in a Text Editor Window.
  4659.  
  4660. SEE ALSO:
  4661. $i$graphics environment$i$
  4662. $$Graphics Environment
  4663. Using Asymptote
  4664. Asymptote uses the current values of various parameters when it draws text, lines 
  4665. or points.  These parameters are called the $i$graphics environment$i$.  They are:
  4666.    scale        ± sizes of points, labels and tick marks           see: $b$scale$b$ 
  4667.             default: 1.0
  4668.    rotation    ± rotation of points and labels (CCW in ¡)        see: $b$rotation$b$ 
  4669.             default: 0.0
  4670.    fillpattern    ± pattern for filling points and polygons        see: $b$fillpattern$b$ 
  4671.             default: 1 (black)
  4672.    penpattern    ± pattern for drawing lines                see: $b$penpattern$b$ 
  4673.             default: 1 (black)
  4674.    pensize    ± thickness of the pen when drawing lines        see: $b$pensize$b$ 
  4675.             default: 1.0
  4676.    pencolor    ± color of all graphics and text            see: $b$pencolor$b$ 
  4677.             default: black
  4678.    pendash    ± dash pattern to use when drawing lines        see: $b$pendash$b$ 
  4679.             default: solid
  4680.    penmode    ± transfer mode for graphics                   see: $b$penmode$b$ 
  4681.             default: 1 (opaque)
  4682.    textmode    ± transfer mode for text                see: $b$textmode$b$ 
  4683.             default: 1 (opaque)
  4684.    fontname    ± font for labels                    see: $b$fontname$b$ 
  4685.             default: Times
  4686.    pointsymbol    ± symbol to plot at each point            see: $b$pointsymbol$b$ 
  4687.             default: 4 cross
  4688.  
  4689. Before you issue a command that draws any graphics (i.e. lines, points or polygons) 
  4690. or labels make sure that the parameters of the graphics environment are set the way 
  4691. you want them to be set.  Use the $i$Status Window$i$ to see what the current 
  4692. values are.
  4693.  
  4694. You can change the default values of the $i$graphics environment$i$ using the $i$Startup Script$i$.
  4695.  
  4696. SEE ALSO:
  4697. $i$Startup Script$i$
  4698. $$Variables & Constants
  4699. Using Asymptote
  4700. Variables and constants make it easier to enter commands and write scripts.  There are 
  4701. two types of variables in Asymptote, user variables, which you define and control, and 
  4702. Asymptote variables, which Asymptote defines and controls.  You can view the current 
  4703. values of all variables in the $i$Variables Window$i$.  Constants are values set by 
  4704. Asymptote that never change.  You use constants most often as the arguments to 
  4705. commands to make commands easier to read.  Letàs take a look at how you can use 
  4706. variables and constants in your Asymptote scripts.
  4707.  
  4708. $b$USER VARIABLES: ________________________________________$b$
  4709. If you want to define your own variables, use the $b$set$b$ command.  See the $b$set$b$ help page
  4710. for more information.
  4711.  
  4712. $b$ASYMPTOTE VARIABLES:____________________________________$b$
  4713. When Asymptote starts up it creates a number of variables which you can use to make 
  4714. your commands and scripts more flexible.  Many of these variables are variables of the 
  4715. $i$graphics environment$i$, such as the current size of the pen or the current position of 
  4716. the pen in graph coordinates.  Other variables are the current number of points or the x 
  4717. and y limits of your graph.  Asymptote automatically updates the values of these 
  4718. variables to reflect current conditions.  For example, to move the pen to the lower left 
  4719. corner of the graph frame you could type the command
  4720.     moveto xleft ybottom
  4721. which uses the variables xleft and ybottom, the x and y coordinates of the bottom left 
  4722. corner of the graph frame.  The advantage or writing the moveto command this way is 
  4723. that it moves the pen to the lower left corner of the graph frame regardless of the limits 
  4724. of the graph.
  4725.  
  4726. In another example, you could use the variable scale, to change the scale factor to twice 
  4727. its current value with the scale command as follows:
  4728.     scale scale 2 *
  4729. Issuing the scale command this way has an advantage because no matter what the current 
  4730. scale factor is, the new scale factor will be twice as big.  For example, you can use this 
  4731. command to draw a title on the graph twice the size of the tick mark labels.  You can 
  4732. restore scale to its original value with the scale command as shown below:
  4733.     scale scale 2 /
  4734.  
  4735. The following is a list of all Asymptote variables and the commands you can use to
  4736. change their values.
  4737. $b$Command$b$        $b$Value$b$
  4738. x        ± x position of the pen in graph coordinates
  4739. y        ± y position of the pen in graph coordinates
  4740. gx        ± x position of the pen in page coordinates
  4741. gx        ± y position of the pen in page coordinates
  4742.  
  4743. xleft        ± left side of graph (in graph coordinates)        see: $b$graphlimits$b$
  4744. xright        ± right side of graph (in graph coordinates)    see: $b$graphlimits$b$
  4745. ybottom    ± top of graph (in graph coordinates)        see: $b$graphlimits$b$
  4746. ytop        ± bottom of graph (in graph coordinates)        see: $b$graphlimits$b$
  4747.  
  4748. gleft        ± left side of graph (in page coordinates)        see: $b$graphframe$b$
  4749. gright        ± right side of graph (in page coordinates)        see: $b$graphframe$b$
  4750. gbottom    ± top of graph (in page coordinates)            see: $b$graphframe$b$
  4751. gtop        ± bottom of graph (in page coordinates)        see: $b$graphframe$b$
  4752.  
  4753. pleft        ± left edge of the page (in page coordinates)        see: $b$graphframe$b$
  4754. pright        ± right edge of the page (in page coordinates)    see: $b$graphframe$b$
  4755. pbottom    ± bottom of the page (in page coordinates)        see: $b$graphframe$b$
  4756. ptop        ± top of the page (in page coordinates)        see: $b$graphframe$b$
  4757.  
  4758. npts        ± current number of points                see: $b$npts$b$
  4759. scale        ± maximum number of points            see: $i$Memory Use$i$
  4760.  
  4761. scale        ± current scale factor                see: $b$scale$b$
  4762. rotation    ± current rotation (in degrees)            see: $b$rotation$b$
  4763.  
  4764. pensize    ± current pen size                    see: $b$pensize$b$
  4765. penmode    ± current pen transfer mode                see: $b$penmode$b$
  4766. penpattern    ± current pen pattern number            see: $b$penpattern$b$
  4767. fillpattern    ± current fill pattern number            see: $b$fillpattern$b$
  4768.  
  4769. startline    ± current start line to read                see: $b$datalines$b$
  4770. endline        ± current end line to read                see: $b$datalines$b$
  4771. startcolumn    ± current starting column to read            see: $b$datacolumns$b$
  4772. endcolumn    ± current end column to read                see: $b$datacolumns$b$
  4773.  
  4774. notation    ± current notation format                see: $b$notation$b$
  4775. digits        ± current number if significant digits        see: $b$digits$b$
  4776.  
  4777. $b$CONSTANTS:____________________________________________$b$
  4778. When Asymptote starts up, it defines a number of constants for you.  As mentioned 
  4779. above, you can't change a constant because they have special values that make typing 
  4780. script commands easier.  For example, the single argument to fillpattern is a pattern 
  4781. number 0 through 38.  To set the fill pattern to a light gray pattern, you could 
  4782. type the command like this:
  4783.     fillpattern 23
  4784. Or, you could type the command using the constant lightgray, which Asymptote has set 
  4785. equal to 23.  Using the constant, the command becomes
  4786.     fillpattern lightgray
  4787. which is much easier to read and to remember.
  4788.  
  4789. The following table lists all Asymptote constants and some examples of how 
  4790. you can use them in commands.
  4791. $b$Name$b$        $b$Value$b$        $b$Example of Use$b$
  4792. open         0        pointsymbol 4 open
  4793. cross         1    
  4794. star         2    
  4795. filled         3    
  4796. belowleft     1        drawlabel belowleft This is a label
  4797. below         2    
  4798. belowright     3    
  4799. centerleft     4
  4800. center         5
  4801. centerright     6
  4802. aboveleft     7
  4803. above         8
  4804. aboveright     9
  4805. bottom     1        drawaxis top line inside parallel nolabels
  4806. left         2        drawframe parallel perpendicular nolabels
  4807. top         3
  4808. right         4
  4809. ticks         1
  4810. noticks     0
  4811. inside         1
  4812. outside     2
  4813. line         1
  4814. noline         0
  4815. parallel     1
  4816. perpendicular 2
  4817. nolabels     0
  4818. none         0        fillpattern none
  4819. black         1        penpattern black
  4820. darkgray     3
  4821. gray         4
  4822. lightgray     23
  4823. white         20
  4824. vertical     8
  4825. horizontal     27
  4826. diagonal     28
  4827. squares     11
  4828. bricks         12
  4829. opaque         1        textmode opaque
  4830. transparent     2        penmode transparent
  4831. reversed     3
  4832. erase         4
  4833. inverted     5
  4834. clear         6
  4835. overlay     7
  4836. whiteout     8
  4837. solid         0        pendash solid
  4838. dot         1        pendash dot long dot short
  4839. short         4
  4840. long         8
  4841. decimal     -2        notation decimal
  4842. float         -1
  4843. general     0
  4844. default     1
  4845. scientific     2
  4846. ddmmss     3
  4847. hhmmss     4
  4848. true, yes, on     1        fullscreen true
  4849. false, no, off     0    
  4850. closed         1        plotpolygon closed
  4851.